Running PHP on IBM/Lotus Domino server - php

I would like to host Wordpress and Magento PHP sites on a IBM/Lotus Domino Server with plans to integrate with Lotus Notes databases.
I have installed PHP 5.3.29, MySQL 5.6.21.1, phpMyAdmin 4.2.10.1
I am NOT running IIS or Apache.
I am running IBM Domino Enterprise Server 9.01 with HTTP Server task.
I have created the URL-->Directory mapping doc in the Domino Directory:
Incoming URL String: /*.php
Target server directory: c:\php\php-cgi.exe /*.php
Access Level: Execute
I have created a directory 'php' in the Domino HTML folder (c:\domino\data\domino\html\php)
I created a info.php file that displays phpinfo():
<?php phpinfo(); ?>
I am able to bring up http://domain.com/php/info.php perfectly. !!
I am able to run phpMyAdmin and create MySQL db's.
I am able to install and configure Wordpress.
HOWEVER I must add index.php to any URLs that only include the directory.
For example /wp/wp-admin/index.php works.
But /wp/wp-admin/ or /wp/wp-admin return status 403 and error:
Unable to process request, directory browsing is not allowed
SO Here is my question:
How can I get the Domino HTTP service to look for index.php in addition to index.htm & index.html when a URL is only of the directory? If there is a file named index.html in the Domino HTML directory, you need only use the directory name. How to add index.php to the list of files to look for if only a directory is in the URL? Is there some configuration file where I can add index.php to the list?
Please note that I am not using Apache so the .htaccess file has no effect (correct me if I am wrong) in the Domino HTTP environment.
Thanks in advance.

I was able to host a Wordpress site on a Domino 9 server running the optional IBM HTTP Server (IHS). All running on Windows Server 2008 R2.
First, Domino 9 Server must be installed with the option 'IBM HTTP Server' -- you have to do a Custom installation to see the choice. This installs IBM HTTP Server (IHS) which is a version of Apache that integrates with Domino HTTP.
IHS is installed in the Domino directory 'ihs'. The ihs\conf\domino.conf file needs to be edited -- most of it is OK as is. The file domino.conf is used instead of httpd.conf which would normally be used to run IHS without the Domino HTTP connection.
Add domino\ihs\bin\ httpd.exe to your Firewall rules since it will now be receiving the HTTP requests and proxying them to the Domino server on a different port. This setup will allow the installation of TLS encryption certificates, for example.
Make edits to domino.conf:
Uncomment line:
Listen 0.0.0.0:80
Comment out SetHandler domino-handler :
<IfModule mod_domino.c>
...
#<LocationMatch /*>
#SetHandler domino-handler
#</LocationMatch>
</IfModule>
Append the following at the end of domino.conf:
LoadModule dir_module modules/mod_dir.so
DirectoryIndex index.html index.htm index.php
Win32DisableAcceptEx
LoadModule php5_module "C:\php\php5apache2_2.dll"
<IfModule php5_module>
AddType application/x-httpd-php .php
PHPIniDir c:/php/
</IfModule>
NameVirtualHost *:80
#default vhost for Domino HTTP:
<VirtualHost *:80>
ServerName "${DOMINO_SERVER_NAME}"
DocumentRoot "${DOMINO_DOCUMENT_ROOT}"
<IfModule mod_domino.c>
<LocationMatch /*>
SetHandler domino-handler
</LocationMatch>
</IfModule>
</VirtualHost>
# vhost for wordpress.domain.com
<VirtualHost *:80>
ServerName wordpress.domain.com
DocumentRoot "${DOMINO_DOCUMENT_ROOT}/wp"
</VirtualHost>
Secondly, to install PHP5 on IHS, we have to use the thread safe version -- I had previously installed the non-thread safe (nts) versions configured for 'Other CGI' which did not allow for a php module that could be loaded by the IHS (Apache) server.
PHP 5.3.29 VC9 x86 Thread Safe (2014-Aug-15 20:02:15)
Installer [38.38MB] http://windows.php.net/downloads/releases/php-5.3.29-Win32-VC9-x86.msi
I used the PHP installer program - install PHP in C:\PHP, choose Apache 2.2.x Module during web server setup.
I copied the Wordpress files into the Domino html directory domino\data\domino\html\wp .
Finally, to run IHS on Domino, edit notes.ini and add:
HTTPIHSEnabled=1
Restart the HTTP task on the Domino server. Pay attention to console to make sure there are no errors with domino.conf file.
The above configuration will send ALL HTTP requests on port 80 to the Domino HTTP task as normal with the exception of wordpress.domain.com which will continue to be handled by the IHS server instead of the Domino server.
The Virtual Host doc in the Domino directory for wordpress.domain.com is not needed, and the URL-->Directory mapping doc in the Domino Directory I originally added is now no longer needed (and now there is no c:\php\php-cgi.exe file).
Note that Domino does no logging of any IHS virtual hosts that are not handled by Domino.

According to the book "IBM HTTP Server on z/OS: Migrating from Domino-powered to Apache-powered" (p.42, bottom) there exists a Welcome directive in Domino, which should do the same as DirectoryIndex in Apache.
This should do the trick:
Welcome index.php index.html index.htm
although I do not know where to put that... but maybe you already know that.

Related

test.php is returning page not found

It's my first webpage and everything was ok until I had to set up server and install PHP to star coding the back end part.
I installed MySQL 1.4, Visual Studio 2015, VC14, Apache 2.4 and PHP 7.1.
MySQL is running as well as Apache. I was able to open localhost:8080 with the message "It works" but when I try localhost:8080/test.php it opens a 404 page not found.
The error log in Apache folder says:
[php7:error] [pid 3276:tid 956] [client ::1:65240] script 'C:/Apache24/htdocs/test.php' not found or unable to stat
The test.php file is on Apache24/htdocs.
I've already tried so many options, installed and deinstalled versions of PHP, Visual Studio, and nothing. Thank you for helping me.
Here is the httpd file which I edited:
I added those 4 line at the beginning:
AddHandler application/x-httpd-php .php AddType
application/x-httpd-php .php .html LoadModule php7_module
"c:/php7/php7apache2_4.dll" PHPIniDir "c:/php7"
Definde the SeverRoot:
Define SRVROOT "c:/Apache24" ServerRoot "c:/Apache24"
Changed the Listen port
Listen 8080
List item
Changed the ServerName localhost: ServerName localhost:8080
DocumentRoot
DocumentRoot "c:/Apache24/htdocs"
"c:/Apache24/htdocs">
put your test.php at folder XAMPP/htdocs. XAMMP Panel, turn on Apache and MySQL. Then open your browser and type localhost/test.php

PHP Symfony apps on OSX El Capitan apache

I have installed the symfony_demo application on El Capitan (10.11.2)
If I run the inbuilt PHP server as follows:
php app/console server:run 127.0.0.1:8111
the demo application is Live at localhost:8111
but if I access the application via El Capitan's inbuilt apache instance (by copying it into my <user>/Sites directory), I just get a directory listing.
Note that I do have PHP enabled on apache, and other PHP-based applications run through apache as currently configured (e.g. Joomla).
What more configuration of apache do I need?
Addendum:
I am running the Server version of the OS. I read that there exists another apache configuration file at: /Library/Server/Web/Config/apache2/httpd_server_app.conf
But uncommenting the vhosts .conf and .so directives and restarting 'Websites' via the Server app in this file made no difference to the behaviour
You'll need to uncomment few lines in your /etc/apache2/httpd.conf. Remove the # in front of the following lines if it's there (these lines are in different parts of the file):
LoadModule php5_module libexec/apache2/libphp5.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
Include /private/etc/apache2/extra/httpd-vhosts.conf
Next, you can edit /etc/apache2/extra/httpd-vhosts.conf to define your virtual hosts. For example if your project is located in /Users/username/Sites/symfony (replace "username" with your username, and "symfony" with you project directory):
<VirtualHost *:80>
ServerName symfony.dev
DocumentRoot "/Users/username/Sites/symfony/web/"
<Directory "/Users/username/Sites/symfony/web/">
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
</VirtualHost>
In the example I used a fake domain symfony.dev. If you want to use it you'll need to add it to your /etc/hosts file (add a new line there):
127.0.0.1 symfony.dev
After changing apache's configuration don't forget to restart it:
sudo /usr/sbin/apachectl restart
You might need to adapt the vhost config to your needs. Read more about configuring the web server in the Symfony documentation.
Success!
The pivotal information here is that the Server version of OSX has it's own configuration which disables .htaccess redirection by default.
After finding the setting in Server > Websites > Server Website (edit) > Edit Advanced Settings > "Allow overrides using .htaccess files
And restarting Websites, the symfony demo works fine at http://localhost/symfony_demo/web/
n.b.: No need for vhosts - that's merely a convenience

Post request not working Drupal and Ubuntu 14.04

In my ubuntu 14.04 OS machine for drupal 7 login not working, may be it is not only login but all post request not working here. For the same filesystem and codebase it works fine in windows 7 machine.
Here is my apache server configuration:
<VirtualHost *:80>
ServerName somedomain.local
DocumentRoot "/home/mycompany/Development/Projects/Drupal/cbb"
<Directory "/home/mycompany/Development/Projects/Drupal/cbb/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
for above configuration when i try to submit data for login it showing..
"NetworkError: 404 Not Found - http://somedomain.local/user".
#UPDATE:
I just find out that login not working only from www.domainname.local/user path but if this login form in homepage sidebar it works fine, for all of drupal sire in ubuntu machine. With this no error message also not display.
I am in trouble for two of my drupal site in Ubuntu machine. Any help will be appreciated.
Check if .htaccess file present in drupal root directory.
Check if you've added your domain to /etc/hosts file
127.0.0.1 domain.name
Domains with 'www' and without it are totally different. Add both to /etc/hosts and to apache's config file to avoid problems.
Clear cache to avoid previous domain name which could be stored in cache.
drush cc all
If you've just added new site to apache's configuration be sure to run:
sudo service apache2 graceful
Your Apache vhost file looks like it has the key components set and I'm assuming that the .htaccess file exists in your document root and hasn't been modified from the Drupal default.
When you click on the login link in the sidebar, does it take you to http://somedomain.local?q=user/login ?
Your #update suggests that even though your Apache environment may be set up for "clean URLs", the feature is not enabled in Drupal at Administer > Configuration > Search and metadata > Clean URLs.
If modifying this compromises your access to Drupal, you can apply/disable this change via Drush (drush vset clean_url 0 --yes) or directly through MySQL (UPDATE variable SET value = 's:1:"0";' WHERE name = 'clean_url';) as per https://www.drupal.org/node/5590.
Also worth mentioning, seeing it on this related question (Very strange Drupal 7 404 behaviour): make sure that Apache modules mod_rewrite and mod_headers are enabled:
sudo a2enmod rewrite
sudo service apache2 restart

Getting blank PHP page over Apache

In a newly setup digitalOcean cloud server (CentOS), I have installed php and Apache. The webserver is running fine:
[root#a2m5cent01 httpd]# service httpd status
httpd (pid 11232) is running...
[root#a2m5cent01 httpd]# php --version | head -1
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
But browser is showing blank pages (white page) if I try to visit any php page.
Here is what I have done so far to troubleshoot:
Created a page with following content: <?php phpinfo(); ?>. It displays a blank page when viewed from browser.
Just to ensure, apache is pointing to the correct directory, placed a static .html page there, and saw it comes out fine in browser, so apache is working and directory is correct.
In /etc/php.ini, changed display_errors directive to On. Still blank page
In Apache config file (/etc/httpd/conf/httpd.conf) found this line Include conf.d/*.conf. Inside conf.d directory, there is a php.conf file containing the line:
LoadModule php5_module modules/libphp5.so. Ensured that this .so file actually exists in this place.
In the same file I have these two lines as well: AddHandler php5-script .php and AddType text/html .php
Executed the php page from CLI, it works fine - so php is working locally.
Then why is it always shows a blank/white page over the browser? What else am I missing?
EDIT
Based on suggestions from #Nathan,
I checked Apache error log file, could not see any error being
reported there.
My /etc/php.ini says, php error_log is located as syslog. So I checked /var/log/messages but could not find any PHP error message
Next I put some normal HTML in the php file containing phpinfo() call. Interestingly I found that even the normal HTML texts are also not coming. It still produces blank page.
Then I checked Apache access log. Surprise! There is no GET request for any of the PHP files I tried to load in the browser. But GET request for all the non-php files are there with 200 return code.
Apache is not even logging any access request for PHP files. Any idea why would that happen?
check out your phpinfo() script.
<?php
phpinfo();
?>
missing the "php" behind the first "?" will give a blank page
I think your php installation with apache is faulty. Thats why you can not see any php page in your webserver. Clean remove all the existing apps, like httpd,php,php-fpm,php-cli etc. and try to clean isntall in this order
yum install httpd -y
yum install php php-common php-cli php-gd php-curl php-fpm -y
then make sure you restart yout httpd server.
service httpd restart
Install mod_fastcgi:
yum install mod_fastcgi
Start the service:
service php-fpm start
Restart Apache:
service httpd restart
5. Configuration of Apache with PHP-FPM
Open the fastcgi.conf file:
nano /etc/httpd/conf.d/fastcgi.conf
Add this to the end of the file:
<IfModule mod_fastcgi.c>
DirectoryIndex index.html index.shtml index.cgi index.php
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>
After that search after "FastCgiWrapper" and make sure it's set to "off" then save the file.
The /usr/lib/cgi-bin/ directory must exist, so we create it:
mkdir /usr/lib/cgi-bin/
If mod_php is installed and enabled, we need to disable it so open the configuration at /etc/httpd/conf.d/php.conf:
nano /etc/httpd/conf.d/php.conf
Comment out the AddHandler and AddType lines so it looks like here:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
#AddHandler php5-script .php
#AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
Save the file and restart Apache:
service httpd restart
Are you navigating to the php file directly? Or are you just going to the directory root?
If the later, Apache might not be recognizing .php as the directory index.
To test, try create a .htaccess file in your web root containing the following line:
DirectoryIndex index.php
I have the same issue...
The problem is in the iptables. (It seems like it)
Try with:
service iptables stop
## check if it stop...
service iptables status
Then try to reload the page again.
If you had other solution please share.
[edit]
Restarting the iptables service is working for me.
Try:
service iptables restart
First of all you should check the permissions of your file.
If you don't grant read-permission to public, Apache produces a blank page without showing any errors.
It's been sometime, but I wanted to come back to this question to update that the issue was with the directory permission setup.
The FPM user I was using didn't have necessary permission to execute the index.php file in the web root.
To avoid these issues in the future, I have created an automated bash script that will automatically create and configure webservers in DigitalOcean boxes. Please take a look here https://github.com/akash-mitra/fairy
This script will automatically,
Installs Nginx
Create virtual server block for nginx
Installs PHP, PHP APC, PHP Curl etc.
Supports PHP Fast Process Manager (php-fpm)
Installs Memcached
Installs Database (MariaDB / MySQL)
Optionally Installs PHP Composer and Laravel
Configures and Strengthens SSH
Activates Firewall
Optionally enables SWAP space in DO server and fixes a locale issue
Since everything looks at its default state, have you checked this part just for confirmation
cat /etc/php.ini | grep log_errors
If log_errors is disabled then enable it and check this below log after restarting httpd.
/var/log/httpd/error_log
--
Also check this part from php configuration.
cat /etc/php.ini | grep error_reporting
This value should be enabled by default so that display_errors will work.
error_reporting = E_ALL
Sorry to repost an old thread...this is important.
I also was having these problems where no html response was outputting
After double-checking php.ini or my apache conf files and was still receiving no output, I later found out that I was suppressing the error of an include / require of a class, with #, which was nested within a constructor function. There was a syntax error in the included file, which stopped all output altogether when errors were thrown.
So, check your handlers first.
If you are storing all your output into vars first and you are including various scripts first that fail you'll have to see those errors. If you suppress file handler errors, you'll get a blank screen if you have a syntax error in the file.
Search your files for all instances of # in your php code. Then turn #include "/path_to/script.php"; to include "/path_to/script.php"; or anything #$foo into $foo as such var might reference a dependency that is causing your script to end with nothing showing in the httpd error log or in the http response.

Can't view index.php of Zend Framework 1.0 after setting up Apache/Host requirements?

UPDATE: the following error is coming up in the Apache error logs...
[Sat Dec 08 16:41:39 2012] [error] [client 127.0.0.1]
PHP Fatal error: require_once():
Failed opening required 'Zend/Application.php'
(include_path='/Library/WebServer/Documents/quickstart/library:.:/php/includes:/Users/markmcdonnell/Dropbox/Library/PHP/ZendFramework-1.12.0/library')
in /Library/WebServer/Documents/quickstart/public/index.php on line 18
I'm using Mac OSX 10.8.2 (Mountain Lion) and I'm having problems getting the Zend framework set-up and running (just the basic QuickStart).
I'm using Apache 2.2.22
My localhost files are accessible from /Library/WebServer/Documents
I have PHP 5.3.15 running as well.
I've created a new project via the command line (using the zf.sh file) called 'quickstart' (as per the section on the Zend website recommends) and that is stored here: /Library/WebServer/Documents/quickstart
I've followed both the official Zend website instructions and also an online book about installing Zend: http://www.survivethedeepend.com/zendframeworkbook/en/1.0/creating.a.local.domain.using.apache.virtual.hosts
My php.ini (/private/etc/php.ini) file has been updated to include the path to the library folder inside the ZendFramework directory...
include_path = ".:/php/includes:/Users/<home>/Dropbox/Library/PHP/ZendFramework-1.12.0/library"
I've updated /etc/apache2/httpd.conf so it includes...
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
# Ensure "localhost" is preserved unchanged pointed
# to the default document root for our system.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents
</VirtualHost>
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerName quickstart.local
DocumentRoot /Library/WebServer/Documents/quickstart/public
SetEnv APPLICATION_ENV "development"
<Directory /Library/WebServer/Documents/quickstart/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
...I've also updated /etc/hosts so it includes...
127.0.0.1 localhost
127.0.0.1 quickstart.local
I'm restarting Apache using sudo apachectl graceful (I've also used sudo apachectl restart)
So if I try and now access http://localhost/ I see my /Library/WebServer/Documents directory and I can see PHP is running still with no problems. But if I try and access http://quickstart.local/ I just get an empty page?
Can any one advise as to what the problem might be, what I'm missing and what I can do to get the initial 'welcome' page to display.
I'm sure I'm just missing someone small, but it's obviously causing problem enough for the basic page not to show.
Thanks.
Mark
Just for others who may have followed this. The answer by Kamil, above, will work, but opens a security hole outside Apache's security configuration. That's fine as long as you know it and have another layer of security above Apache.
Another way to resolve the problem is to put the ZendFramework somewhere inside the root directory's hierarchy. Like:
DocumentRoot/Library/WebServer/Documents/ZendFramework-1.12.0/library
or
DocumentRoot/Library/WebServer/Documents/quickstart/public/ZendFramework-1.12.0/library
Any path that's inside the root directory of your Apache server.
Maybe a user permissions issue between the Zend files and the Apache process.
Since you can create the project using zf.sh, the Zend files are obviously there. But the fail you get via Apache suggests that the Zend files might not be accessible via the Apache process (that is, the user under which the Apache process runs).
$ chmod 0777 /Users/markmcdonnell/Dropbox/Library/PHP/ZendFramework-1.12.0/library
to test.
You could probably get away with much less expansive permissions - 0644, for example - but I confess I'm terrible at that aspect of it. ;-)

Categories