[SOLVED] having slight prob getting a localhost (virtual host) up and running properly
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
having slight prob getting a localhost (virtual host) up and running properly
I'm trying to setup a localhost Virtual webpage sight. nothing fancy.
this is as far as I got. now I am getting a Error 403 access forbidden.
I know it has to be the httpd.conf I just do not know where. the link to the instructions is here, and his httpd.conf looks like this guy declairs a VirtualHost in that file in an area that calls for it, then again in the vhosts.conf by creating a new dir to vhosts then a file.
whereas My setup has within the httpd.conf a path to lookin /httpd/extras/httpd-vhosts.conf
here is my homemade www directory structure, user, owner, permissions
Code:
[root@voided brainwave.bw]# ls -la /www/
total 12
drwxr-xr-x 3 root root 4096 Feb 16 10:18 .
drwxr-xr-x 19 root root 4096 Feb 16 10:18 ..
drwxr-xr-x 5 brainwave brainwave 4096 Feb 16 10:19 brainwave.bw
[root@voided brainwave.bw]# ls -la /www/*
total 20
drwxr-xr-x 5 brainwave brainwave 4096 Feb 16 10:19 .
drwxr-xr-x 3 root root 4096 Feb 16 10:18 ..
drwxr-xr-x 2 mysql mysql 4096 Feb 16 10:19 databases
drwxr-xr-x 3 brainwave brainwave 4096 Feb 16 10:43 html
drwxr-xr-x 2 brainwave brainwave 4096 Feb 16 10:44 logs
[root@voided brainwave.bw]# ls -la /www/*/*
/www/brainwave.bw/databases:
total 8
drwxr-xr-x 2 mysql mysql 4096 Feb 16 10:19 .
drwxr-xr-x 5 brainwave brainwave 4096 Feb 16 10:19 ..
/www/brainwave.bw/html:
total 16
drwxr-xr-x 3 brainwave brainwave 4096 Feb 16 10:43 .
drwxr-xr-x 5 brainwave brainwave 4096 Feb 16 10:19 ..
drwxr-xr-x 2 brainwave brainwave 4096 Feb 16 10:18 cgi-bin
-rw-r--r-- 1 userx brainwave 95 Feb 16 09:33 index.html
/www/brainwave.bw/logs:
total 16
drwxr-xr-x 2 brainwave brainwave 4096 Feb 16 10:44 .
drwxr-xr-x 5 brainwave brainwave 4096 Feb 16 10:19 ..
-rw-r--r-- 1 root root 476 Feb 16 10:54 brainwave.bw-access_log
-rw-r--r-- 1 root root 1267 Feb 16 10:54 brainwave.bw-error_log
I think the problem may lay within this area, but I have moded it a few times between going from one how to set this up to another page of how to set this up always getting stuck on I am sure a rather easy fix.
Code:
ServerRoot "/etc/httpd"
# Mutex default:/var/run/httpd
User httpd
Group httpd
ServerName 127.0.0.1:80
#maybe this
<Directory />
AllowOverride none
Require all denied
</Directory>
##or this
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/httpd"
<Directory "/srv/httpd">
# Virtual hosts
Include /etc/httpd/extra/httpd-vhosts.conf
though it makes mention of using aliases I'd like to know more about how to format that and what it is all about too.
If I have not given enough information let me know whats missing.
Using Unix Groups
Most users will want to be able to modify their content without being root. The easiest way to achieve this is through the use of Unix Groups; you create a group to which you add your content editing user, then you add the httpd user to that group.
Note that this doesn't easilly extend to more than one user who needs to edit the files, since at that point you need to set Group write on the files. One would need to use ACL's to achive this.
For example, we have a user "alice" who needs to edit our content, stored in /var/www/html/
First we create the content group, then we add both alice and apache to it.
# groupadd web-content
# usermod -G web-content alice
# usermod -G web-content apache
Now we need to set the right permissions on our files.
# chown -R alice:web-content /var/www/html
# find /var/www/html -type f -exec chmod 640 {} \;
# find /var/www/html -type d -exec chmod 750 {} \;
What we've done here is to set all files to 640, or rw-r----- and directories to rwxr-x---. Because the group "web-content" is applied to all the files and directories, httpd can read these files, but cannot write to them.
YEP that did it as far as writting to the dir, now I need to get it working on the client side.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.