atfinho
2 months ago
1000
2
Servers

Virtual Host Set up

Posted 2 months ago by atfinho

Hey Guys

I'm trying to set up a virtual host for my project I'm using Ubuntu 16.04

I'm facing 2 issues right now

first , I switched to this directory /etc/apache2/sites-available/

I simply copied **000-default.conf** to another file example.conf

then

sudo a2ensite example.conf to enable the new file

sudo a2dissite 000-default.con to disable the old one

inside example.conf I have

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName example.test
    ServerAlias www.example.test
    DocumentRoot /opt/lampp/htdocs/pixmania-front-v2/Apps/Pixmania/Front/htdocs/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I edited /etc/hosts

127.0.0.1 example.test

right now when I type example.test on browser it redirects me to example.test/dashboard

couldn't know why...

Later on , I tried a solution that I found on stackoverflow which is to comment out **httpd-vhosts.conf ** in **httpd.conf ** this solution redirects me to 403 error on localhost !

I hope you can help me!

Please sign in or create an account to participate in this conversation.