Apache2 installed and running but access problem

Hi all,

I got a little problem with altering the permissions of my www folder and some files (apache conf files like document root). I can access them but when i change them i can’t save them. Clearly a permission problem. So i figure to use chmod and set permissions.

Strangely this didn’t work. Also tried to modify users and groups but nothing happened.


client>chmod 755 srv/www/htdocs/

Looks like the correct code does it? Or am i doing something wrong?

I have an apache server set with these:
sudo chmod -R 755 /path_to/doc_root
sudo chown -R john:users /path_to/doc_root

That might fix the problem, but if not, there’s a bit more background reading here:
HowTo: Configure a Linux Apache Web Server on Suse/openSUSE

Thanks, this helped ;). However, does this work also with the configuration files? I just want to edit the documentroot so it becomes more accessible :).

Lets say: /usr/username/desktop?

Can you use a whole lot more words to say that again – I’m not the least bit familiar with your setup :wink:
e.g. what configuration files and what is the relevance of /usr/username/desktop to your web server

I just want to edit the httpd file so i can change the documentroot of the apache webserver. I’m a little lazy about this, hehe. I’ll give you an example.

My server is configured or set to (documentroot): /srv/www/htdocs This directory is not accessible because of the permissions set by SuSE. So if i want to edit index.html i need to set the permissions to my user account (like you told me). If i don’t do this i can edit the file but not save it. However, i browsed through my personal folders and saw a public_html folder, which is more accessible than /srv/www/htdocs.

In order to change this i need to set the documentroot to /home/username/public_html. But my httpd.conf consist of “includes” to other files. So i need to know if the command is useful for configuration files.

Anyway, i’ll figure it out. Thank you very much for helping me :slight_smile:

Kind regards,

drcomputer

Ok, depends a bit how you set the configuration, perhaps using Yast??
It’s pretty simple once you locate the vhost config file.
Show me the contents of the directory /etc/apache2/vhosts.d/ and we’ll see if Yast used Virtual Hosts.
(you can use this console command: ls -l /etc/apache2/vhosts.d)

It’s a permissions problem…

If i don’t do this i can edit the file but not save it

Open the file manager with su i.e kdesu dolphin
Browse to file open with editor of choice from file manager and you’ll have the correct permissions.

Or open it exactly as in kdesu kwrite /path/to/file

Though I thought the yast httpd interface made this easy.

Instead of changing the stock DocumentRoot, just enable virtual hosting and make a default virtual host with your new DocumentRoot and any other settings you want to override. That way you don’t need to modify the standard setup.

I have to confess… I’m like a newbie to this and although the interface is easy, i’d like to learn both ways. I was a windows guy and setting up a apache webserver under windows is lots easier than on linux(SuSE in my case). In windows you have just one httpd.conf file to edit and it is donė. In linux however, you have lots of files for settings i don’t even understand.

I just use apache for development only and locaŀ. The rest is upto my webhoster when i upload the files.

It is done now, i’ve found the documentroot of the server and it is workinġ. Weļŀ, apache iş, haha. Now i have to check if PHP is working which i assume it is working.

I do have one last question about linux. I’m learning every day, especially about BASH but is there some info out there to learn and practice? I mean real good info, not some tutorial on how to install or configure things?

Anyway, it is solved now. Thanks for the help guys (and ladies if present). I hope to be able to help others like you helped me :).

It’s not just Linux it can be distro specific, I use a distro that also uses one global config, can’t answer why Suse went for split.

As for learning by doing :wink: and breaking and fixing. I tend to use the GUI a lot more in Suse as that is the way it is geared up, and then resort to manual edits when the GUI fails me.(Though my latest 11.1 is gui-less)

I found the quickest way I learned was by playing with the puzzle distro’s. What do I mean by that? The ones that you put together piece by piece, you’ll bang your head against the desk for days at a time. Eventually it becomes easier and the skills acquired doing such like distro’s make the user friendly ones easier to deal with. Just have to remember the distro quirks.

Playing with gentoo got me started but frustrated the hell out of me. Then think slackware is a similar model and arch is a binary. But afaik they all start you with the very basics, not a lot more than network stack, kernel and shell.

Then as my sig learning google-fu took the longest, the answers are normally always out there. Though I’ve been defeated by one and just may yet ask the noob question on the irc channel.

After you have configured Apache a bit on openSUSE, you realise that the multiple file setup is not limiting at all, but in fact has advantages. In actual use, at most a few lines from default-server.conf or listen.conf need to be edited, then left alone. All the rest can be done using files in conf.d and vhosts.d. Conf.d is for setting app or subsystem wide defaults, one per file, e.g. php5.conf, python.conf, while vhosts.d is for virtual hosts, one per file. The fact that they are one per file makes it easy for YaST to manage them, editing one vhost doesn’t affect others, and you just need to kick Apache with a reload signal after modification.

I do not understand or know YaST like you do probably, However, like i said before, it’s just for developing purpose and not for heavy duty. I’m like a simple guy not thinking to hard. I know, on the other hand i’d like to learn more about linux which is probably harder than scripting in PHP.

Anyway, thanks for the help and answer ;).

FM>: I found the quickest way I learned was by playing with the puzzle distro’s

DC>:You mean the LFS (Linux From Scratch) project? (maybe one day i will do just that, hehe. Building my own distro ;).)

FM>:you’ll bang your head against the desk for days at a time.

DC>: I’d rather not do that, hehe. You shouldn’t be doing that either, hehe.

I got problems with Debian, Ubuntu and SuSE. Most of the time the installer is installing untill it needs the install DVD. Especially SuSE is asking for a CD instead of a DVD. And when finally done my screen is not working. Either it is the drivers or it is not listening to the analog signal so i have to use the digital signal. It is not a problem anyways, hehe.

Thanks for your help and time ofcourse. I think i will be starting to read on the LFS project soon.