Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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...

share|improve this question
    
I assume your htdocs is on NTFS partition. Here is answer to why chmod did not take effect: Chmod on NTFS –  Jaroslav Bucko Sep 3 '12 at 10:57
add comment

1 Answer 1

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:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.