How do I set up a virtual host?

Posted by user1698332 on Server Fault See other posts from Server Fault or by user1698332
Published on 2012-09-25T21:07:40Z Indexed on 2012/09/25 21:39 UTC
Read the original article Hit count: 245

Filed under:
|
|
|
|

My router redirects port 80 to port 8080.

This is my virtual hosts file:

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /home/admins/lampstack-5.3.16-0/apps/wordpress
    ServerName example.com
    ServerAlias www.example.com
</VirtualHost>

I can access my website by entering "mywebsite.com:8080" but I cannot access it by entering "mywebsite.com"

For further information, this is a part of my httpd.conf:

Listen 8080
Servername localhost:8080
DocumentRoot "/home/admins/lampstack-5.3.16-0/apache2/htdocs
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny, allow
    deny from all
</Directory>
<Directory "/home/admins/lampstack-5.3.16-0/apache2/htdocs">
    Options FollowSymLinks
    AllowOverride None
    Order allow, deny
    allow from all
</Directory>

© Server Fault or respective owner

Related posts about html

Related posts about linux