LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   user homepages (https://www.linuxquestions.org/questions/linux-software-2/user-homepages-80129/)

ignavus 08-08-2003 09:05 AM

user homepages
 
Might be that this thread should've been posted under the newbie-section, but I'll give it a go here anyway.

I'm running a computer with slackware 9.0 on our local network (no inet, which is a problem I'll get to another time), meant to serve ftp and web (http/php, etc). I've created a test-account, with its own home-area (home/test1), and I want this user to have an area in this directory that can be used as a public_html-area - accessible from other computers on the network as "slackware-server/test1" through the http-protocol. How do I do this?

I've read several different faq's both on LQ and the respective homepages of the software-distributors - Apache and Slackware - but I haven't found anything regarding the subject. The closest I got was the faq on vhosts on the apache-site, but I'm not sure if that's what I'm looking for.

Any help will be appreciated, thank you.


And btw, the server is already responding through http as a newly installed apache-server, so I know it's working as it should. Installation also includes both MySQL and PHP, which both work perfectly.

rch 08-08-2003 09:17 AM

well if you just want to share the files,nfs would suffice but I don't think that is what you are looking for ,you should configure your apache server ,set up networking and you're done,if that is what I read from your query!
Correct me if i'm wrong?
How to do that ?
Aren't the apache manuals enough?

jharris 08-08-2003 09:36 AM

As already mention nfs/samba might be more suitable for sharing files, however to answer the question.

Create public_html under /home/test1. Check that the following is in your httpd.conf
Code:

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

Restart apache as necessary (clearly you'll need mod_userdir available but this is on by default). Put some files in /home/test1/public_html. Access http://server/~test1

HTH & welcome to LinuxQuestions

Jamie...

ignavus 08-08-2003 11:02 AM

Quote:

Originally posted by jharris
As already mention nfs/samba might be more suitable for sharing files, however to answer the question.


The samba-part could be interesting (it's a windows-network btw, so I guess it would have to be samba in that case), but I've had difficulties setting up samba before, and I figured it would be faster to just setup and use ftp for this purpose.



Quote:

Create public_html under /home/test1. Check that the following is in your httpd.conf
Code:

<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

Restart apache as necessary (clearly you'll need mod_userdir available but this is on by default). Put some files in /home/test1/public_html. Access http://server/~test1



I tried just creating the public_html-folder inside the /home/test1 -folder, but I couldn't browse to the index- and php-files I put in there from the windows-computer. Hopefully it will work when I add the lines you mention above here, unless they are included by default..? I haven't tampered alot with the httpd.conf included with the slackware 9.0 installation, but I'll have to check it out on monday - can't reach the linux-comp from here, as it's located at work.


Thanks for all the help anyway, I'll get back to this as soon as I can :newbie:

jharris 08-08-2003 11:04 AM

Check the permissions on the files (644), the permissions and the permission on your /home /home/temp1 and /home/temp1/public_html directorys (711, 711, 755 respectively). Also check that Indexes are allowed on your apache server.

cheers

Jamie...

ignavus 08-11-2003 03:45 AM

Quote:

Originally posted by jharris
Check the permissions on the files (644), the permissions and the permission on your /home /home/temp1 and /home/temp1/public_html directorys (711, 711, 755 respectively). Also check that Indexes are allowed on your apache server.

Now I have a home-dir called test1, that contains the public_html-subdir, with an index and a phpinfo-file.

I'm not sure about how to set permissions and stuff, so it would be great if you could just give me some insight in to how it's done (chmod / chown ?)

The settings in the httpd.conf seems alright, although I'm not sure about the part on allowing indexes either.

jharris 08-11-2003 04:11 AM

Quote:

Originally posted by ignavus
I'm not sure about how to set permissions and stuff, so it would be great if you could just give me some insight in to how it's done (chmod / chown ?)
Yeah thats right, chmod. So something like chmod 755 /home would allow the owner of /home (hopefully root!) to read write or execute the directory and everyone else to just read and execute. Have a read of the following for an explination of file permissions http://math.bnu.edu.cn/Ebook/OR_Prac...y/ch05_01.html
Quote:

Originally posted by ignavus
The settings in the httpd.conf seems alright, although I'm not sure about the part on allowing indexes either.
If you look in your httpd.conf file you'll seen lines (typically with a <Directory ..></Directory> block) that say things like
Code:

Options FollowSymLinks Indexes
The indexes option means that if you went to http://someServer/someDir/ and the someDir directory didn't contain an index.html file then the Apache server will return a listing of the contents of the directory. If this option wasn't present then the Apache server would tell you that you didn't not have permissions to view the directory.

That make things a little clearer?

cheers

Jamie...

ignavus 08-11-2003 06:56 AM

Quote:

Originally posted by jharris
That make things a little clearer?

Absolutely, and thanks for the useful info :)

Somehow I managed to make the test1-page work as well, but I'm not sure how I did it. Might be that it had something to do with the permissions, but it seems okay now.

Thanks again.


All times are GMT -5. The time now is 05:59 PM.