I have big problems with my vhosts. Situation: I have a RPS server, and a dozen domains configured to point to this server.
I managed to bind, and then try to manage Apache, and I use virtual hosts to manage sub-domains for example.
Only a few weeks, without my knowledge why, nothing goes, and I think it shows that I have misconfigured something (and perhaps misunderstood, at the base).
That translates into the fact that some of my domains are not accessible, sometimes only the subdomains are but "http://domain.com" does not work ...
When I say "not working", it says on Firefox:
Not Found
The requested URL / was not found on this server.
I have a folder "assets" which simply replaces "sites-enabled". This is just for practical reasons I stated in apache2.conf I wanted to be it who is taken into account.
In "active" I have a file for each domain. Each file is roughly made the same way:
Code:
<VirtualHost my.fine.address.ip:80>
ServerName domain1.com
Redirect permanent / http://www.domain1.com
</VirtualHost>
<VirtualHost my.fine.address.ip:80>
ServerAlias *.domain1.com
VirtualDocumentRoot /home/mynickname/domain1/%-3+/
</VirtualHost>
They told me on IRC (# httpd on Freenode) not without benefit to pass to talk to me like a mongolian (I love IRC), I have had anywhere my.fine.address.ip:80 (with My IP instead, you can imagine).
So I put everywhere. They also told me "for each VirtualHost, you need a DIFFERENT ServerAlias". Until proven otherwise, it is good.
They also told me that I should not have two VirtualHost one after the other as it is in every file ... possible.
Then, in my conf.d 000-default contains:
Code:
NameVirtualHost my.fine.address.ip:80
<VirtualHost my.fine.address.ip:80>
ServerName localhost
DocumentRoot "/var/www/"
<Directory />
Options FollowSymLinks
AllowOverride None
</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 /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/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>
They asked me on IRC the result of apache2ctl-S.
Code:
VirtualHost configuration:
my.fine.address.ip:80 is a NameVirtualHost
default server localhost (/etc/apache2/conf.d/000-default:3)
port 80 namevhost localhost (/etc/apache2/conf.d/000-default:3)
port 80 namevhost pineapple.com (/etc/apache2/actifs/pineapple:1)
port 80 namevhost apple.com (/etc/apache2/actifs/pineapple:5)
port 80 namevhost kiwi.us (/etc/apache2/actifs/kiwi:1)
port 80 namevhost apple.com (/etc/apache2/actifs/kiwi:5)
port 80 namevhost apple.com (/etc/apache2/actifs/apple:1)
port 80 namevhost apple.com (/etc/apache2/actifs/apple:5)
port 80 namevhost banana.com (/etc/apache2/actifs/banana:1)
port 80 namevhost apple.com (/etc/apache2/actifs/banana:5)
port 80 namevhost orange.cat (/etc/apache2/actifs/orange:1)
port 80 namevhost apple.com (/etc/apache2/actifs/orange:5)
port 80 namevhost mango.us (/etc/apache2/actifs/mango:1)
port 80 namevhost apple.com (/etc/apache2/actifs/mango:5)
port 80 namevhost pear.com (/etc/apache2/actifs/pear:1)
port 80 namevhost apple.com (/etc/apache2/actifs/pear:5)
port 80 namevhost cherry.com (/etc/apache2/actifs/cherry:5)
port 80 namevhost apple.com (/etc/apache2/actifs/cherry:9)
Syntax OK
I have replaced my domain names with the names of fruit. As you see, it's just a mess. Finally I think. In short, how to fix it and do things properly?
Bookmarks