I am using one software, who can save files to /var/tmp but not in /var/www/*.*.

I did applied chmod -R 777 /var/www. But still it can write to /var/tmp but not /var/www

How can I resolve this? (I know its secured but its very private testing purpose)


You can change your default folder for www content by editing the information provided inside the /etc/apache2/sites-available/default file. By dropping sudo gedit /etc/apache2/sites-available/default and changing any occurrence of the /var/www or (maybe your case) /var/www/html and setting the folder that you wish to use.

The contents of the file will look like this:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/geppettvs/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /home/geppettvs/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128


In this case I am using my /home/geppettvs/www folder in order to place the files that will be exposed to the public via http connections (port 80).

Give this a try. I hope this help you.

Good luck!

  • I have 2 files in my /etc/apache2/sites-available directory called '000-default.conf' and 'default-ssl.conf' and I tried changing all the instances of the directory '/var/www/html' to '/var/www'. When I type 'localhost/myPhpFile.php' into the web browser it is still looking in the '/var/www/html' folder. What do? – GoProCameraByGoPro Mar 15 '15 at 3:03
  • You should reset Apache in order to the changes take effect. It is usually automatic when computer's reboot but if you haven't yet try with sudo apache2ctl restart and inform if you succeed. Additionally you can try clearing your web browser's cache in order to the browser get the new data from the proper places. – Geppettvs D'Constanzo Mar 15 '15 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy