Re: User access to /srv/www/htdocs



houghi wrote:
Ram wrote:
Hi,

I've just got ' Beginning PHP5, Apache, Mysql, Web Development' for xmas this book is aimed at windows user with appendix for setting up on Linux. I already have the apps installed on my mail server.

My question is how do I create a 'test' folder in /srv/www/htdocs to run the examples in the book. I know I could su create the folder and then chmod it, but is there away I can do it with group permissions for the user.

When you install Apache, these folders will be made for you. Here is what I did to get my stuff going as a user AND be able to test is very easily.

As root I do `mkdir /srv/www/htdocs/website`, then I do `chown
houghi:users /srv/www/htdocs/website`
Next, again as root, I make the follwoing file:
/etc/apache2/vhosts.d/houghi.conf This file can have any name, as long
as it ends in *.conf Look in the directory for more examples. This is
how mine looks like:
<VirtualHost *:80>
    ServerAdmin houghi
    ServerName houghi
    DocumentRoot /srv/www/htdocs/website
    ErrorLog /var/log/apache2/houghi-error_log
    CustomLog /var/log/apache2/houghi-access_log combined
    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature On
    <Directory "/srv/www/htdocs/website">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

I then reastart apache with `rcapche2 restart` and if there are no
errors, I can log out. I will now be able to reach the website with
http://houghi

Then as user I want it to be able to reach it easily, so I do `ln -s
/srv/www/htdocs/website` in my homedirectory. Now I can add a page in
~/website. I add test.php with first just `hello world` as content.

I then look at http://houghi and see the file test.php wich I click and
I should be able to see `Hello world`.

To sum it up:
1) make directory as root
2) chown (change owner) from directory
3) Add virtual host
4) restart Apache
5) symlink directory


Step 5 is not really needed. However it is convinient.


Cheers for this,

Works a charm.

Ram
.



Relevant Pages

  • Re: User access to /srv/www/htdocs
    ... When you install Apache, these folders will be made for you. ... ServerAdmin houghi ... I then reastart apache with `rcapche2 restart` and if there are no ... You are about to enter another dimension, ...
    (alt.os.linux.suse)
  • Re: Just Bought SUSE 9.1!!
    ... if all open source projects are using Bugzilla then where's the ... houghi, this reply has absolutely nothing to do with apache. ...
    (alt.os.linux.suse)
  • Re: GUI for configuring Apache2?
    ... On Wed, 20 Jun 2007, houghi wrote:- ... have existed quite a few GUI's both commercial and free for the old Apache ... Member of Team Acorn checking nodes at 50 Mnodes/s: http://www.distributed.net/ ...
    (alt.os.linux.suse)
  • Re: Just Bought SUSE 9.1!!
    ... if all open source projects are using Bugzilla then where's the ... Apache anyone? ... New content, new layout. ...
    (alt.os.linux.suse)
  • Re: missing apachectl in suse90?
    ... i'm sorry but in apache 2.* it is call apache2ctl... ... houghi wrote: ... > Do 'pin apachectl' ... > HTH HAND ...
    (alt.os.linux.suse)