2

I'm migrating from Windows to Ubuntu.

I've installed Apache on Ubuntu. It keeps files in /var/www/ folder. When I was on Windows, I've had used XAMPP, which keeps files in /xampp/htdocs/.

So I don't have my projects on Ubuntu, and I should copy them from Windows htdocs to www directory. It's easy for once time.. but if I edit a project in ubuntu, it won't be accessible on Windows.. (I mean I want to have 1 folder for xampp htdocs on Windows and www folder on Ubuntu, and keep them the same and updated)

I've created a link to htdocs folder and put it in www folder, but when the browser point to "http://localhost/windows_htdocs", it says:

403 Forbidden

Should I change permission of all directories and files in XAMPP htdocs folder to solve the problem? It doesn't cause any problems for my Windows?

Although, I've tried to change the permission of a folder in the htdocs directory by chmod command, but it didn't take effect, and permission didn't changed...

Oli
  • 293,335
mrdaliri
  • 1,013

1 Answers1

0

Using the default configuration for Apache is only going to get you so far. If you ever want to host more than one site you're going to need to get involved with the virtual hosts settings.

In my opinion, rather than shovelling files all over the place or even linking them, I would opt to just change the configuration so Apache on Ubuntu looks at the Windows versions.

And that's simple. Edit /etc/apache2/sites-available/default as root and change DocumentRoot to your new path. You'll need to edit the default <Directory /var/www/> opening tag too. Then do a graceful restart and it should load the new config.

sudo /etc/init.d/apache2 graceful

Permissions are still important so you'll still need to make sure you've mounted things in the right way, per Jaroslav's comment:

Oli
  • 293,335