HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   FastCGI PHP and permissions issue on ISPConfig perfect server (opensuse 11.3) (http://www.howtoforge.com/forums/showthread.php?t=51176)

wildnux 28th January 2011 23:03

FastCGI PHP and permissions issue on ISPConfig perfect server (opensuse 11.3)
 
I am having some permission issues with my site. I do not know a lot about vhosts (on the process of learning ) and apache directives. I am trying to run php as cgi and I have them with .cgi extension.

(I am trying to setup my personal server to do my school projects and the school project require .cgi extension for php - they work on school servers so i want to setup my server to do the same so that i can work on my own computer which is way faster than working on school servers)

My expectations:
* php run as cgi script, (php files with .cgi extensions)
* give 701 permissions for directories and .cgi files and 604 for others except for some php files which are accessed by the .cgi files themselves. I want 600 for these files
* site work with the above settings

What it currently does:

* php runs as cgi script with .cgi extensions, i added .cgi on AddHandler line, but it has to be 711 permission. if i give no permissions to group, it will not run.


I do not want to give any permission to group, and go with 701, 604 etc, how can i achieve that?

Another minor problem: the school servers check for the shebang line and if there is no shebang line, it gives error, mine just ignores shebang line and works without it, it is not that important for me, as i will be running it only web script, but will love to know how to do that.

here is my vhost file, please ask for more files if you need to see. (newbie, don't know much):

Code:

<Directory /srv/www/csce4420.dyndns.org>
    AllowOverride None
    Order Deny,Allow
    Deny from all
</Directory>

<VirtualHost *:80>
      DocumentRoot /srv/www/clients/client2/web4/web
 
    ServerName csce4420.dyndns.org
    ServerAlias www.csce4420.dyndns.org
    ServerAdmin webmaster@csce4420.dyndns.org

    ErrorLog /var/log/ispconfig/httpd/csce4420.dyndns.org/error.log


    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html
       
    <Directory /srv/www/csce4420.dyndns.org/web>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    <Directory /srv/www/clients/client2/web4/web>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>


    # suexec enabled
    SuexecUserGroup web4 client2
    # Clear PHP settings of this website
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
    </FilesMatch>
    # php as cgi enabled
    ScriptAlias /php5-cgi /srv/www/php-cgi-scripts/web4/php-cgi-starter
    Action php5-cgi /php5-cgi
    AddHandler php5-cgi .cgi .php .php3 .php4 .php5
    <Directory /srv/www/php-cgi-scripts/web4/>
        Order allow,deny
        Allow from all
    </Directory>

    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
      AssignUserId web4 client2
    </IfModule>

    <IfModule mod_dav_fs.c>
      # DO NOT REMOVE THE COMMENTS!
      # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
      # WEBDAV END
    </IfModule>


</VirtualHost>

Please give me some suggestions and show me some path. I have other two hosts on the same server, one has joomla cms and other drupal and are running fine with fastCGI, but this one I need it to be slightly different. I found out the school server uses cgi/fastCGI also using phpinfo.

they have the following for cgi/fastcgi which i also have:

cgi.check_shebang_line 1 1
cgi.fix_pathinfo 1 1
cgi.nph 0 0
cgi.rfc2616_headers 0 0
fastcgi.logging 1 1


BTW, I have ISPConfig 3.0.3.2

Thank you :)


All times are GMT +2. The time now is 15:34.

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