I am pretty new to development and this is why I am stuck at such a "beginners" problem.
I want to have a directory under /var/www/mysite with a index.html and access it via web browser on my PC (Win10 64 Bit) by typing mysite.example into it.
I don't want to publish anything into the internet with that. I only want to test and develop a site which later might be hosted.
I have created a VirtualMachine using Oracle VirtualBox and installed Ubuntu16.04 (64-Bit, also enabled Virtualization at my i5 2500 in Bios so I get these 64-Bit displayed).
Then I installed apache2, mysql and php.
ip addr show
gave me an address: 192.168.178.31.
So if I type into my browser http://192.168.178.31/
I get to the apache2 default page - It works!
I created the directory /var/www/mysite and put a simple index.html for testing purpouse into it. I said sudo chown -R 775 to /var/www/
.
Now I need to create a vhost so I can access to this index.html in this specific directory by typing in a specific string into my browser. But it just won't work!
I went to /etc/apache2/sites-available/ and created mysite.conf.
This is the content:
<VirtualHost *80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mysite
ServerAlias mysite.example
</VirtualHost>
I did a2ensite mysite.conf
, sudo service apache2 reload
and restart
So there I am. If I type mysite.example into my browser I only get errors.
Site not reached. DNS-Server for mysite.example not found and so on (ERR_NAME_NOT_RESOLVED).
192.168.178.31 mysite.dev www.mysite.dev
into itshosts
file, @nico? Within the above context it is a machine from your 'virtual` LAN, and the local machine is the virtual Ubuntu system. Apparently I must clarify this in the answer. – pa4080 Aug 01 '17 at 13:54/var/www/mysite/
and its content they must be similar as these of/var/www/html/
. Also check the names of all paths carefully. Don't forgot to restart (or reload) Apache after each configuration change! Did you edit/etc/apache2/apache2.conf
for any reason? – pa4080 Aug 02 '17 at 11:00