0

I'm using Apache 2 in Linux mint and I don't know where to store my files and projects. if I store it in var/www it is not accessible for me, I have to use command as super user. Are there any way to solve my problem? - If I want to store in my home folder, what should I type in the address bar if I want to run my file? - Are there any other good solution than these? (such as change the accessible to folder /var, or change the Root_Url of apache ...)

6 Answers 6

4

The easiest way to solve this provlem is by typing the following line in terminal:

sudo chmod -R 777 /var/www

and then enter your password. And now you are done. You can store all the PHP files in /var/www

Sign up to request clarification or add additional context in comments.

Comments

0

You have to do a chmod, you can have more information in your terminal with comand man chmod to set the rights to write in that folder or else point the web-server elsewhere (the setting is in the https.conf file)

Comments

0

There is different solutions:

in both cases your project must have gives permissions to the apache user (www-data?) to read/execute you project

Comments

0

You need to active the user_dir mod of apache and then run the content from your home folder.

To run a file in your hole directory you should go to localhost/~youruser/script.php of course after enabling user_dir

Comments

0

Everything depends on the use.

If you are looking for a configuration for a development server that is accessible only from limited host (such as localhost):

  1. You can configure Apache (/etc/apache2/apache2.conf) to run with your user/group.

User myuser

Group mygroup

  1. Store all your project in your user_dir (/home/myuser/projects/...)

  2. Create a virtual host for any of your projects

All files generated by your server will be accessible to you and vice versa

Comments

0

One way to accomplish this is to edit the default virtualhost supplied with Apache 2. In Linux Mint 14 its configuration file is located at:

/etc/apache2/sites-enabled/

This directory should hold symlinks for all active sites, for me the default is named 000-default.

Change the lines with "DocumentRoot" and "Directory" to point wherever you like. The server should have read only privileges by default. If you are working on file manipulation then it will need permission to read and write files.

Once this is set, restart the server ("sudo service apache2 restart") and type localhost in your browser to access the directory you've set above.

For more advanced configs have a look at:

http://community.linuxmint.com/tutorial/view/853

http://community.linuxmint.com/tutorial/view/527

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.