How do I set up a virtual host?
- by user1698332
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>