谁能帮我看看同一台机器多个域名的apache的配置啊?始终配不出来。

巴林的狗尾草 发布于 2013/08/04 13:29
阅读 332
收藏 0

我的目的是让server能够将从两个不同的域名过来的请求映射到不同的程序上面。打架帮我看看有没有错误?为什么始终不行呢?

这里是在/etc/apache2/sites-enabled下面的三个文件,

这个是default:


<VirtualHost *:80>
#       ServerName qianzi.net.tf

        ServerAdmin webmaster@localhost

        DocumentRoot /var/www

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
这个是qianzi.net.tf



<VirtualHost 219.235.1.10>
        ServerName qianzi.net.tf
        
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
这个是engeneer.net.tf



<VirtualHost 219.235.1.10>
        ServerName engeneer.net.tf
        
        ServerAdmin webmaster@localhost

        DocumentRoot /var/blog

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/blog/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>


        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


加载中
0
bingl
bingl
php应用?是ubuntu server ?
0
巴林的狗尾草
巴林的狗尾草

引用来自“bingl”的答案

php应用?是ubuntu server ?
php应用
0
徐迎龙
徐迎龙

推荐一个,用redirect_cp

http://www.oschina.net/p/redirect_cp

0
王涛
王涛

如果可以的话,建议用nginx

个人感觉nginx的配置比apache要简单一些

返回顶部
顶部