×

Loading...
Ad by
Ad by

Create new VirtualHost in httpd.conf. detail info see Contents

Create new VirtualHost in httpd.conf

<VirtualHost 10.10.10.1>
ServerName www.test.com
<Directory "/home/test/docs/">
Options Includes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DocumentRoot /home/test/docs
DirectoryIndex index.html index.htm
CustomLog /home/test//logs/access_log '%h www.test.com %l %u %t "%r" %s %b "%{referer}i" "%{user-agent}i"'
ErrorLog /home/test/logs/error_log
ScriptAlias /cgi-bin/ /home/test/cgi-bin/
</VirtualHost>
Report

Replies, comments and Discussions:

  • 工作学习 / 专业技术讨论 / 知道这里IT DX多.请教个LINUX装MySQL++的问题. 请见内.
    系统是RedHat 8.0 (很久前下载的,不知道现在哪个版本好用)
    下载安装了MySQL 5.0
    下载安装MySQL++2.1.1时出错,说是 can't find working MySQL client library!

    有谁知道怎么解决吗? 如有需要,稍后我可以把config.log发上来. 先谢拉!
    • 没人知道?还是这个问题太初级?高手来帮帮忙...
    • locate libmysqlclient.so include library /usr/local/mysql/lib/mysql/
      • 我猜也是这个库的问题,就是不知道怎么弄,后来重装了一便就好了.用WINDOWS多了,养成动不动重装系统的习惯了..哈哈...多谢指点.
    • 1. simple way, go http://rpm.pbone.net/ search compiled binary package (.rpm file) for you platform and install it. 2. complex (professional)way, go mysql website and check,
      make sure you have download all the source code, dependency code for the platform you are using. And check README/INSTALL mannual carefully. Follwoing the instruction on those manual, When have problem, use google search for solusion.

      which way do u want? I assume that you are working on application but not mysql hacker.

      If it is your first time use mysql, i suggest the first one. After a while, when you need extra feature that doesn't include in the pre-compile package, u can make your own compilation.

      As I know, mysql is pretty simple(I just use pre-compile package). I did compile php several time to fit my requirement.

      Have fun.
      • 多谢这么详细的指点...就是没看懂去下载哪个RPM? 头一次弄LINUX 和 MYSQL, 还请多指点
        昨天我重新装了一遍RedHat8, 下载安装了低版本的MYSQL 4.1.18, 然后在安装mysql++-2.1.1. 这次又没问题了.不知道到底是哪儿的问题...其实,我是想用C++写个CGI,能够访问MYSQL数据库.昨天好不容易在自己的机器上编译成功,放到网站上又不WORK了..有关Linux/Apache/mysql 的问题,以后我还要多向你请教. 谢过了先..:)
        • u can try php. it is script language, easy compatible between systesm.
          • 也许你误会了我的意思,再近来帮看看....
            我必须要用C++ compiled CGI, 而不是PHP.

            MYSQL++的问题已经解决了.现在新的问题是,刚装了APACHE 1.3.34 (为了保持和我HOST的版本一致,所以装的老版本), 但是CGI-BIN的目录不让我访问,不是 File not found, 就是do not have permission. 不知道到底应该怎么配制才能从broswer访问cgi-bin.

            我试着改了httpd.conf, 在 <Directory /usr/local/apache/cgi-bin> 里加了 Options ExecCGI , 然后重启apache, 但没有效果. 还有,更奇怪的是,在/usr/local/apache/httpdoc/ 下改动任何文件,broswer还是显示原来的页面,加个新文件,比如test.html,在broswer里,说do not have such file. 但/usr/local/apache/httpdoc 的确就是 DocumentRoot 里指定的目录啊.

            再帮忙看看...:)
            • Create new VirtualHost in httpd.conf. detail info see Contents
              Create new VirtualHost in httpd.conf

              <VirtualHost 10.10.10.1>
              ServerName www.test.com
              <Directory "/home/test/docs/">
              Options Includes FollowSymLinks ExecCGI Includes
              AllowOverride All
              Order allow,deny
              Allow from all
              </Directory>
              DocumentRoot /home/test/docs
              DirectoryIndex index.html index.htm
              CustomLog /home/test//logs/access_log '%h www.test.com %l %u %t "%r" %s %b "%{referer}i" "%{user-agent}i"'
              ErrorLog /home/test/logs/error_log
              ScriptAlias /cgi-bin/ /home/test/cgi-bin/
              </VirtualHost>
              • 没注意原来default的httpd.conf里有没有<VirtualHost>,你的意是是说,原来没有,我要加进去?等我回去试试..多谢!
            • 我帮你看看:-)
              1。改httpd.conf不会立即生效,要restart apache.
              2. 你要知道拿个apache 在运行。
              netstat -nap | grep http
              很可能你新装的apache根本没运行,是旧的/usr/sbin/httpd

              你可以kill掉旧的:
              kill -9 ` ps -elf | grep httpd | gawk '{print $4}'`
              然后运行新的:
              /usr/local/apache/bin/apachectl start

              3.httpd 一般以httpd 或者nobody用户运行,你的httpdoc目录下的文件需要读权限,cgi文件需要运行权限。

              chmod 644 /usr/local/apache/htdocs/*
              chmod 755 /usr/local/apache/cgi-bin/

              你现在用不着virtualhost。
              • 多谢...周末重新装了一遍系统,问题就都没了.可能是原来安装用的参数有问题. 你提到的方法,对我这个LINUX低手有点深,看不懂.呵呵.
    • don't make things complex, if there is simple way to make it.
    • 应该配置一下MY.CONF就可以了