Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th May 2009, 19:17
longvnit longvnit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Cool How to config Apache 2.x PHP 5.x with SuPHP

I used latest version of apache, php and suphp.
I compiled by command bellow :

Code:
### compile apache
./configure \
--prefix=/usr/local/apache \
--enable-layout=Apache \
--enable-modules=all \
--enable-mods-shared=all \
--enable-proxy \
--enable-suexec \
--enable-so \
--with-mpm=prefork \
--with-suexec-caller=apache \
--with-suexec-userdir=public_html \
--with-suexec-docroot=/home \
--with-suexec-logfile=/dev/null \
--with-suexec-safepath=/usr/local/bin:/usr/bin:/bin:/usr/home:/usr/sbin \
--disable-dav \
--disable-dav-fs


### compile php
./configure \
--prefix=/usr/local/php \
--with-mysql=/var/lib/mysql \
--with-config-file-path=/etc \
--enable-cgi \
--enable-force-cgi-redirect \
--enable-mbstring \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-zlib-dir=/usr/lib \
--with-freetype-dir=/usr/lib \
--without-sqlite \
--with-mysql-sock=/var/lib/mysql \
--with-bz2 --with-curl --enable-bcmath --enable-exif --with-gd \
--with-zlib --enable-calendar --with-openssl --with-gmp \
--enable-ftp --enable-magic-quotes --with-mcrypt --with-mhash --enable-ctype \
--enable-tidy --enable-dom --with-libxml-dir=/usr/lib --enable-libxml --enable-xml \
--enable-xmlreader --enable-xmlwriter --enable-zip --enable-shmop --enable-wddx \


### compile suphp
./configure \
--prefix=/usr/local \
--with-apache-user=apache \
--with-apr=/usr/local/apache/bin \
--with-logfile=/usr/local/apache/logs/suphp.log \
--with-apxs=/usr/local/apache/bin/apxs \
--with-min-uid=500 \
--with-min-gid=500 \
--with-apr=/usr/local/apache/bin


### Suphpconfig in /usr/local/etc/suphp.conf

[global]
;Path to logfile
logfile=/usr/local/apache/logs/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=apache

;Path all scripts have to be in
docroot=/home:${HOME}/public_html
;docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot

; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true

;Send minor error messages to browser
errors_to_browser=true

;PATH environment variable
env_path=/bin:/usr/local/php/bin

;Umask to set, specify in octal notation
umask=0133

; Minimum UID
min_uid=500

; Minimum GID
min_gid=500


[handlers]
;Handler for php-scripts
x-httpd-php="php:/usr/local/php/bin/php-cgi"

;Handler for CGI-scripts
x-suphp-cgi="execute:!self"

### Suexec info

 -D AP_DOC_ROOT="/home"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/dev/null"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin:/usr/home:/usr/sbin"
 -D AP_UID_MIN=100
 -D AP_USERDIR_SUFFIX="public_html"

### httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin admin@longvnit.net
    DocumentRoot "/home/longvnit/public_html"
    ServerName longvnit.net
    ServerAlias www.longvnit.net
    ErrorLog "logs/longvnit.net-error_log"
    CustomLog "logs/longvnit.net-access_log" common
    SuexecUserGroup longvnit longvnit
    suPHP_Engine on
    suPHP_AddHandler x-httpd-php
    suPHP_UserGroup longvnit longvnit
    suPHP_ConfigPath /etc/
</VirtualHost>
But when i used http://longvnit.net then Browser reported Error 403 : HTTP Error 403 Forbidden

I sured that changed mode those folders to 755, files to 644. I used Centos OS 5.2 and Disabled SELinux.

Please help me.
Thanks so much !

Last edited by longvnit; 17th May 2009 at 19:21.
Reply With Quote
Sponsored Links
  #2  
Old 18th May 2009, 00:51
bernholdt bernholdt is offline
Senior Member
 
Join Date: Jun 2007
Posts: 154
Thanks: 45
Thanked 13 Times in 11 Posts
Default

Try this http://www.howtoforge.com/forums/sho...ighlight=suphp Worked for me
__________________
www.gamebook.me
Reply With Quote
  #3  
Old 19th May 2009, 14:53
longvnit longvnit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

Please help me !
Reply With Quote
  #4  
Old 20th May 2009, 16:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Is there an index file (such as index.html) in the document root?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 20th May 2009, 16:49
longvnit longvnit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

i uploaded index.html , it show so good , but file php it show to like this :
http://upnhanh.sieuthinhanh.com/user...m0yj12338.jpeg
Reply With Quote
  #6  
Old 21st May 2009, 18:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Can you post the vhost configuration?
Any errors in Apache's error log?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 21st May 2009, 19:12
longvnit longvnit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

Error_log:

Code:
[Thu May 21 04:11:54 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Thu May 21 04:11:54 2009] [notice] Digest: generating secret for digest authentication ...
[Thu May 21 04:11:54 2009] [notice] Digest: done
[Thu May 21 04:11:55 2009] [notice] Apache/2.2.11 (Unix) configured -- resuming normal operations
httpd-vhost.conf:

Code:
AddHandler x-httpd-php .php
AddType application/x-httpd-php-source .phps


<VirtualHost *:80>
    ServerAdmin webmaster@longvnit.net
    DocumentRoot "/home/longvnit/public_html"
    ServerName longvnit.net
    ServerAlias www.longvnit.net
    ErrorLog "logs/longvnit.net-error_log"
    CustomLog "logs/longvnit.net-access_log" common
    SuexecUserGroup longvnit longvnit
    suPHP_UserGroup longvnit longvnit
<Directory "/home/longvnit/public_html">
    Options -Indexes FollowSymLinks
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
Reply With Quote
  #8  
Old 22nd May 2009, 16:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

You should have something like this in your vhost:
Code:
suPHP_Engine on
suPHP_UserGroup username groupname
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 25th May 2009, 01:24
longvnit longvnit is offline
Junior Member
 
Join Date: Mar 2009
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

I tried again, but it showed :

Reply With Quote
  #10  
Old 25th May 2009, 13:06
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
 
Default

Did you restart Apache?
Does
Code:
httpd -t
show any errors?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
Spamsnake - Problem with spamassassin, FuzzyOcr and MySQL debuguser HOWTO-Related Questions 6 16th September 2008 18:37
ISPConfig 2.2.14 released till General 48 19th July 2007 23:46
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 01:41.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.