setting Virtual Host at Centos 5.5
My linode512 is using centos 5.5 and i'm new at linux. I want to configure virtual host. i was following every steps at library but when i restart httpd, still no change
any suggestions ?
Thanks at advance.
<virtualhost my="" ip:80="">ServerAdmin webmaster@domain.com
DocumentRoot /var/www/html/domain.com/public_html
ServerName domain.com
ServerAlias www.domain.com
ErrorLog /var/log/httpd/domain.com-error_log
CustomLog /var/log/httpd/domain.com-access_log common</virtualhost>
<virtualhost my="" ip:80="">ServerAdmin webmaster@mail.domain.com
DocumentRoot /var/www/html/webmail
ServerName mail.domain.com
ServerAlias mail.domain.com
ErrorLog /var/log/httpd/mail.domain.com-error_log
CustomLog /var/log/httpd/mail.domain.com-access_log common</virtualhost>
<virtualhost my="" ip:80="">ServerAdmin webmaster@domain.com
DocumentRoot /var/www/html/domain.com/public_html
ServerName domain.com
ServerAlias www.tubecolossal.com
ErrorLog /var/log/httpd/domain.com-error_log
CustomLog /var/log/httpd/domain.com-access_log common</virtualhost>
5 Replies
@newdevelop:
any suggestions ?
Which guide did you follow? What does your apache/httpd logs show?
Using your real domains would be more helpful. If nothing else, use domain1, domain2, etc for each unique domain, if you are using more that 1 domain.
The ServerAlias for the "webmail" virtualhost isn't necessary. The 1st and 3rd virtualhost have the same DocumentRoot.
Recommend CentOS virtual hosting method: http://library.linode.com/oTTmil
–
Travis
http://library.linode.com/oTTmil
but only domain1 show at browser when i typed domain2 at browser it sais "can't find
NameVirtualHost my-ip:80
<virtualhost my-ip:80="">ServerAdmin webmaster@domain1.com
DocumentRoot /var/www/html/domain1.com/public_html
ServerName domain1.com
ServerAlias www.domain1.com
ErrorLog /var/log/httpd/domain1.com-error_log
CustomLog /var/log/httpd/domain1.com-access_log common</virtualhost>
<virtualhost my-ip:80="">ServerAdmin webmaster@domain2.com
DocumentRoot /var/www/html/domain2.com/public_html
ServerName domain2.com
ServerAlias www.domain2.com
ErrorLog /var/log/httpd/domain2.com-error_log
CustomLog /var/log/httpd/domain2.com-access_log common</virtualhost>
@newdevelop:
when i typed domain2 at browser it sais "can't find
www.domain2.com ". where directory i can find about apache/httpd logs ?
Do you have working A records for domain2 pointing to the right IP address?
Apache logs on Centos is usually in /var/log/httpd/
–
Travis
http://library.linode.com/oTTmilhttp://library.linode.com/yZPAEl