Linux.com

Apache installation

Link to this post 16 Mar 10

Hi,
ThanX for tryn'a help.

I've installed apache package on my Ubuntu 9.04, and website directory tree is /var/www/. I don't have write permission with my normal user, I mean the user I created during setup. I always need to use sudo to copy my files, but its extremely foolish, because most of the times I need to keep my file open, for example in Text Editor, and update the page frequently to preview the changes.

How can I gain write access to this folder using this user of mine?

(To tell ya I'm a real beginner. I was a Windows user for more than 7 years, its less than 2 months I've been using Linux).

ThanX for you helps.

Link to this post 16 Mar 10

Keeping it at limited access is best for security reasons. I do not know the default apache right in an ubuntu installation, but if you see that a group has write rights to the directory then you can just assign your user to that group. My method has also been to launch a file editor with root rights to change the specific files (example "sudo gedit /var/www/index.html").

Link to this post 17 Mar 10

the files are owned by www-data. So ... you hace a couple of options ...

you could just sudo -s and do everyting as root (creepy, you shouldn't do this).

You can make yourself a member of the www-data group (se /etc/group) and then make sure that group write permission is turned on for all dirs and files under /var/www.

you can su to www-data (sudo su - www-data) and work as the www-data user.

you can change the ownership on the /var/www directory to your user account (you may have to tweak apache's config to allow your user to execute scipts, etc, e.g. make sure it's not using suexec module).

and I'm sure there are other options that I didn't think of.

Link to this post 17 Mar 10

Thanks so much guys, you really helped.

But now there's another problem I've been facing: Apache configuration!

Does anyone know how can I CHANGE the www directory path? I have another directory, which is in my NTFS drive in windows, where I used to work on my web projects, and now I wanna change the www directory path, to /media/archive/htdocs/ .

How can I configure this? I used to change DocumentRoot option in httpd.conf in windows, but I can't see even a character /etc/apache2/httpd.conf !

How and where should I change the path?

Link to this post 31 Mar 10

I found a part of problem: I compiled and installed apache manually (as opposed to installation using Synaptic) and everything is ok, but there's stil one problem: the apache package that I had installed using synaptic is not completely uninstalled and system paths have not changed, I mean instead of my own compiled package, those installed by synaptic are being executed and I can't start my apache service.

My terminal:


activex@activex-desktop:/usr/local/apache2/bin$ ./apachectl start
(13)Permission denied: make_sock: could not bind to address 127.0.0.1:80
no listening sockets available, shutting down
Unable to open logs
activex@activex-desktop:/usr/local/apache2/bin$

I think now you should know what's the problem. Any idea?

Link to this post 31 Mar 10

Hi,

I think there is a old process running on port :80

check whether it is running using
netstat -plan|grep :80

kill the process using kill -9 process id

then use apachectl to start your new installations.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board