FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2011
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Fedora + LAMP - Virtual Hosts with Home User Privileges HOWTO

    Hallo,

    I just installed Fedora 17 and configured Apache MySql Php with Virtual Hosts using Home User Privileges in a Developper's environment and I would like to share it:

    In Fedora 18, this setup is not working for the moment, since httpd-itk.2.4 has not yet been available through yum. (Check post#4 for a workaround solution)

    1) Install LAMP

    2) Configure Apache UserDir and setup selinux to allow users install a website on a directory they own.

    3) Install httpd-itk to allow apache running a virtual host as owner's "user:group" :
    Code:
    yum install httpd-itk
    Follow the instructions:

    Code:
    cat /usr/share/doc/*itk*/README.Fedora
    It is only additional MPM for Apache web server.
    
    To enable it:
    1) If you are use moderm systemd:
    systemctl stop httpd.service
    systemctl disable httpd.service
    systemctl enable httpd-itk.service
    systemctl start httpd-itk.service
    
    2) If you are still using old sysvinit style:
    Set HTTPD=/usr/sbin/httpd.itk in /etc/sysconfig/httpd and restart daemon:
    service httpd restart
    
    For more information about Apache refer to man and manuals in main httpd package
    4) Create Virtual Hosts

    5) Enable apache to run as user:group

    Code:
    <VirtualHost *:80>
    	ServerAdmin xxx
    	DocumentRoot /xxx/xxx/xxx/
    	ServerName test.loc
    	ServerAlias test.loc *.test.loc
    	ErrorLog xxx
    	CustomLog xxx
    
    	ErrorDocument 403 /403.html
    	ErrorDocument 404 /404.html
    
    	ScriptAlias /cgi-bin/ "xxx/cgi-bin/"
    	<Directory "/xxx/cgi-bin/">
    		AllowOverride None
    		Options None
    		Order allow,deny
    		Allow from all
    	</Directory>
    AssignUserId user group
    </VirtualHost>
    * The above example was pasted from this post

    6) Don't forget to update /etc/hosts :
    Code:
    cat /etc/hosts
    127.0.0.1		localhost.localdomain localhost
    ::1		localhost6.localdomain6 localhost6
    127.0.0.1	test
    And creat a separate virtual host for phpmyadmin:

    Code:
    <VirtualHost *:80>
        DocumentRoot /usr/share/phpMyAdmin
        ServerName phpmyadmin
     </VirtualHost>
    7) Restart and enjoy:
    Code:
    systemctl start httpd-itk.service
    Kind regards,
    tntrush
    Last edited by tntrush; 25th February 2013 at 03:15 PM.

  2. #2
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    16,567
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 17 with LAMP - Virtual Hosts with Home User Privileges HOWTO

    Move to Guides and Solutions.

  3. #3
    Join Date
    Dec 2010
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 17 with LAMP - Virtual Hosts with Home User Privileges HOWTO

    thx for sharing

  4. #4
    Join Date
    Aug 2011
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 18 with LAMP - Virtual Hosts with Home User Privileges HOWTO

    Update:

    After upgrading to Fedora 18, the issue that rises is that httpd-itk.2.4 has not yet been available through yum because it is not properly tested.

    According to http://mpm-itk.sesse.net/:

    There is also a 2.4.4-03 for Apache 2.4 and 2.5.x-pre, last updated 2012-12-31, but it's not as widely tested, so you should exercise some caution. You can download the archive here (the 2.4 series can be built out-of-tree in some cases, so you may no longer have to patch Apache).
    Indeed, in fedora's prompt:

    Code:
    yum list installed | grep http
    httpd.x86_64                     2.4.3-12.fc18      @fedora                     
    httpd-itk.x86_64                 2.2.22-8.fc18      @fedora                     
    httpd-manual.noarch              2.4.3-12.fc18      @fedora                     
    httpd-tools.x86_64               2.4.3-12.fc18      @fedora
    On the other hand, downgrading apache seems to be difficult, as the relevant post for an according compatibility issue in zend framework states clearly:

    http://forums.fedoraforum.org/showthread.php?t=288154#4

    ...I found it pretty difficult to downgrade to Apache 2.2. Installing it from another RPM breaks a bunch of dependencies.
    My choice is to wait until httpd-itk.2.4 gets into yum since -for the time being- I am not entirely fond of tackling deeply with my system due to time constraints regarding my job. Actually, this is the reason why I migrated from gentoo to fedora ...

    However, if a sound solution for fedora 18 is posted, I will surely follow!

    In the meantime, I will arrange my server to run as a global preferred user, which is different than the default. Therefore, I will follow the instructions on arranging for the proper arrangements as stated in the following link:

    http://ryanrhode.com/news/view/ryans...pache-as-a.htm
    1. Change User and Group to your new user in /etc/httpd/conf/httpd.conf

    2. Change the user and group on some things:

    chown -R user:group /var/www
    chown -R user:group /var/lib/php
    chown -R user:group /var/log/httpd
    chown -R user:group /var/lib/php/session

    3. Restart Apache:
    service httpd restart

    Kind regards,
    tntrush
    Last edited by tntrush; 13th February 2013 at 02:03 PM.

Similar Threads

  1. Fedora 11, ISPconfig and virtual hosts
    By robyoko in forum Servers & Networking
    Replies: 2
    Last Post: 11th October 2009, 12:16 AM
  2. Fedora 7 + Apache + Virtual Hosts
    By EvoX in forum Servers & Networking
    Replies: 4
    Last Post: 7th August 2007, 02:19 PM
  3. Apache Virtual Hosts on Fedora 6
    By peter5898 in forum Using Fedora
    Replies: 10
    Last Post: 15th February 2007, 09:50 AM
  4. vsftpd virtual user starting in their home
    By knightdog in forum Using Fedora
    Replies: 0
    Last Post: 21st March 2005, 10:15 PM
  5. virtual hosts problem in fedora core2
    By wolfgang in forum Servers & Networking
    Replies: 3
    Last Post: 9th December 2004, 06:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •