Create virtualhost on windows (apache on ubuntu)

3

I'm trying to set up my apache to access a folder that is in my HD with windows , I have 2 hds on the machine, one runs ubuntu and the other windows .

The apache is already installed, including I already created the file:

/etc/apache2/sites-avaliable/vip.localhost.conf 

I've added the lines:

   ServerName vip.localhost
   ServerAlias vip.localhost
   ServerAdmin webmaster@localhost
   DocumentRoot /media/name/2E4C85684C852BA1/development
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log

I also made the change in the hosts file, but when I try to access vip.localhsot I get the code:

  

403 Forbiden

In the case says that I do not have access to this directory.

Anyone know what I have to do? Do I need to mount a folder on ubuntu so it can access my files? If so, how do I do it?

    
asked by anonymous 22.04.2015 / 17:49

2 answers

2

First of all, make sure that in the assembly of your Windows hard drive, it has read / write permission for user www-data , which is the user Apache runs on Ubuntu

Next, create a file in /etc/apache2/sites-avaliable/seuvhost.conf and the content has to look like this one (for Apache 2.4.X):

<VirtualHost *:80>
    DocumentRoot /media/name/2E4C85684C852BA1/development
    ServerName yourserver.example.com

    <Directory /media/name/2E4C85684C852BA1/development>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Once this is done, enable this new VirtualHost with the command:

sudo a2ensite seuvhost

And restart Apache:

sudo service apache2 restart
    
22.04.2015 / 19:15
1

Another solution is to have a full server with XAMPP (lampp). just install xampp

Dai just start the server and make the settings in VirtualHost.

    
01.10.2015 / 15:55