How To Run PHP 4 And 5 In Ubuntu Without CGI

Jun 21, 2007

When we chose Symfony to implement [url], PHP 5 was needed but we only had PHP 4 installed in our Ubuntu hosting servers. We couldn¡¯t just migrate everyone to PHP 5 since some of client¡¯s applications were incompatible with PHP 5. Some tutorials were found online explaining how to run PHP 4 and PHP 5 simultaneously such as [url] and [url]but they all used CGI. As you probably know, CGI is not scalable and we needed to scale in PHP4 and PHP5 since we needed to server millions of hits in both configurations. The following are additional the requirements we had:

1. Run Apache

2. Use mod_php for both PHP versions.

3. Run eAccelerator with both PHP versions.

4. Use as many Ubuntu packages as possible to ease maintenance issues and easily deploy on multiple servers.

5. Use Ubuntu 6.06.1 LTS

The solution we came up with was to run Apache 2 with PHP 5 and run Apache 1 with PHP 4 on separate IPs. Ubuntu comes already with these packages. The only package we had to compile was eAccelerator. The following lists the steps taken to get this setup:

Apache 2 with PHP 5

* apt-get install apache2 libapache2-mod-php5 php5 php5-cli php5-curl php5-gd php5-mysql php5-dev make php5-mcrypt php5-imap
* vi /etc/php5/cli/php.ini and uncomment extension=mysql.so
* vi /etc/apache2/ports.conf and put Listen Your.IP.Goes.Here:80
* a2enmod expires
* vi /etc/apache2/conf.d/hosting
<VirtualHost *>
DocumentRoot /home/httpd/mainpage
ServerName mainpage.com
ServerAlias www.mainpage.com
Options Includes FollowSymlinks
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.htm
</VirtualHost># Cache images and javascripts
ExpiresActive on
ExpiresByType image/gif ¡°access plus 1 week¡±
ExpiresByType image/jpeg ¡°access plus 1 week¡±
ExpiresByType image/png ¡°access plus 1 week¡±
ExpiresByType image/x-icon ¡°access plus 4 week¡±
ExpiresByType application/x-javascript ¡°access plus 4 week¡±
ExpiresByType application/x-shockwave-flash ¡°access plus 4 week¡±
* cd /usr/local/src
* wget http://bart.eaccelerator.net/source/...-0.9.5.tar.bz2
* tar xjvf eaccelerator-0.9.5.tar.bz2
* cd eaccelerator-0.9.5/
* phpize5
* ./configure
* make
* make install
* mkdir /var/tmp/{eaccelerator4,eaccelerator5}
* chown www-data /var/tmp/eaccelerator*
* chmod 700 /var/tmp/eaccelerator*
* vi /etc/php5/apache2/php.ini and add the following:
zend_extension=¡±/usr/lib/php5/20051025/eaccelerator.so¡±
eaccelerator.shm_size=¡±0¡å
eaccelerator.cache_dir=¡±/var/tmp/eaccelerator5¡å
eaccelerator.enable=¡±1¡å
eaccelerator.optimizer=¡±1¡å
eaccelerator.check_mtime=¡±1¡å
eaccelerator.debug=¡±0¡å
eaccelerator.filter=¡±"
eaccelerator.shm_max=¡±0¡å
eaccelerator.shm_ttl=¡±0¡å
eaccelerator.shm_prune_period=¡±0¡å
eaccelerator.shm_only=¡±0¡å
eaccelerator.compress=¡±1¡å
eaccelerator.compress_level=¡±9¡å

Apache 1 with PHP 4

* apt-get install libapache-mod-php4 php4-mysql php4-gd apache-ssl apache-common libzzip-0-12 php4-common php4-dev apache
* dpkg-reconfigure apache and uncheck mod_userdir and check mod_php4 and cancel on hostname
* vi /etc/apache/httpd.conf and make sure to add this
Listen Your.SECONDIP.Goes.Here:80
NameVirtualHost *# Cache images and javascripts
ExpiresActive on
ExpiresByType image/gif ¡°access plus 1 week¡±
ExpiresByType image/jpeg ¡°access plus 1 week¡±
ExpiresByType image/png ¡°access plus 1 week¡±
ExpiresByType image/x-icon ¡°access plus 4 week¡±
ExpiresByType application/x-javascript ¡°access plus 4 week¡±
ExpiresByType application/x-shockwave-flash ¡°access plus 4 week¡±Remove the following
<IfModule mod_alias.c>
Alias /icons/ /usr/share/apache/icons/

<Directory /usr/share/apache/icons>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /images/ /usr/share/images/

<Directory /usr/share/images>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_alias.c>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</IfModule>

Change
<Directory />
Options SymLinksIfOwnerMatch
AllowOverride All
</Directory>
ServerSignature Off
ServerTokens Prod
* cd /usr/local/src
* rm -rf eaccelerator-0.9.5
* tar xjvf eaccelerator-0.9.5.tar.bz2
* cd eaccelerator-0.9.5/
* phpize4
* ./configure ¨Cwith-php-config=/usr/bin/php-config4
* make
* make install
* vi /etc/php4/apache/php.ini and add the following:
zend_extension=¡±/usr/lib/php4/20050606/eaccelerator.so¡±
eaccelerator.shm_size=¡±0¡å
eaccelerator.cache_dir=¡±/var/tmp/eaccelerator4¡å
eaccelerator.enable=¡±1¡å
eaccelerator.optimizer=¡±1¡å
eaccelerator.check_mtime=¡±1¡å
eaccelerator.debug=¡±0¡å
eaccelerator.filter=¡±"
eaccelerator.shm_max=¡±0¡å
eaccelerator.shm_ttl=¡±0¡å
eaccelerator.shm_prune_period=¡±0¡å
eaccelerator.shm_only=¡±0¡å
eaccelerator.compress=¡±1¡å
eaccelerator.compress_level=¡±9¡å

View 0 Replies


ADVERTISEMENT

Ubuntu VPN Tunnel Between 2 Ubuntu Servers

Dec 29, 2007

way to create a VPN tunnel between two ubuntu servers?

Both will be in seperate datacentres but I'd like a secure tunnel so I can setup jobs to backup to one another.

This has to be done on the server level and cannot be done at the router/firewall as I do not have access to this kit.

View 1 Replies View Related

Ubuntu Or Whatever

Sep 29, 2009

Ubuntu how good it is for hosting platform? also what are its advantages over other os?

View 14 Replies View Related

VPS With Linux Ubuntu 7.1/8.04

May 18, 2009

I'm interested in having an unmanaged VPS with Ubuntu 7.1 or 8.04 installed (or available to Rebuild under the HyperVM) from the state of Missouri (should have at least some IPs already available from the region).

View 2 Replies View Related

Cpanel On Ubuntu

Oct 18, 2009

Are there any issues with Running Cpanel w/ WHM? long story short I heard it had issues with making domains and users because root isn't a user..? I like ubuntu but never ran cpanel on it. I want to use Ubuntu on my dedi. I'm not trying to start a ubuntu vs centos.

View 6 Replies View Related

Ubuntu Desktop VPS

Apr 22, 2009

Does anyone know of a provider that has an Ubuntu Desktop VPS? I've got accounts with fsckvps and xensmart but they only have centos ones - I'll install gnome on of them if I really have to but i'd prefer todo as little leg work as possible as it's for personal use.

View 10 Replies View Related

Ubuntu Vs Cent Os

Jul 18, 2009

Which operative system you mostly use on your server?Right now i have only centos installations,but it seems ubuntu have larger file repository with their apt system compared to yum.

View 14 Replies View Related

Downgrade UBUNTU 9.10

Jun 8, 2009

i upgraded by mistake my ubuntu server to 9.10 from 8.04

How can i downgrade it to 8.04 without loosing My settings?

View 1 Replies View Related

Php.ini On Ubuntu Is Confusing Me

Mar 11, 2009

I am all too familiar with php on my win box but now am working on Linux.

the extension_dir is commented out (??) however CURL does work but there is nothing about CURL in php.ini. I cant find any php.so files.

Also the php.ini file lives in /etc/php5/apache2

Does this look like a standard install? Where do the .so files live?

Ultimatly I want to install Turck MMCache which requires some extensions and when ever I try to do phpize there is the error message
Cannot find config.m4 (google is not helping solve the problem)

apt-get install m4 says I have the latest version.

phpize is a shortcut in usr/bin that points to etc/alternatives/phpize which in turn is a shortcut to usr/bin/phpize5

View 2 Replies View Related

MySQL 5.1.30 On Ubuntu 8.10

Dec 8, 2008

I am trying to create a database using the following method:./mysqladmin create db
But I get the following error:./mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
I am new to configuring mysql. I have installed it etc but not sure how to start it. I tried the following to start the server:moe@moe-desktop:/usr/local/mysql$ sudo bin/mysqld_safe --user=mysql

View 6 Replies View Related

CentOS, Debian, Ubuntu Which Is Better For Vps?

Oct 24, 2009

Which OS is better in security and easy to use for vps beginner:
CentOS™, Debian™, Ubuntu™, Fedora™, or Gentoo™.?

View 14 Replies View Related

Ubuntu Server Or Debian

Jul 9, 2008

I've just ordered a dedicated server with Ubuntu server, but they've come back to me to say that they've had trouble installing Ubuntu server on these particular servers.

As an alternative, they're offering to install Debian. My concern is that I come from a windows background and have spent the last month reading and playing with Ubuntu Server in vmware. I'll be running a small handful of sites on the server and will rely on the apt-get and package installer in webmin to get things set up and for administration. I'll dabble in the shell a little, but only when needed.

Should I go with a different host that can offer Ubuntu, or will I be okay with Debian?

View 9 Replies View Related

Control Panel For Ubuntu VPS

Aug 25, 2008

I have just ordered a VPS from VPSempire to learn more about web servers and server in general.

I hope to install a few free control panels to play around with, webmin doesn't seem enough, what do you recommend?

The VPS is very low spec:

5gb Hard Disk Quota
50gb Monthly Bandwidth
128mb Guaranteed Ram
256mb Burstable Ram

View 9 Replies View Related

Does Any Host Have VPS's Running Ubuntu

Jul 25, 2008

Does any host have VPS's running Ubuntu?

View 14 Replies View Related

Ubuntu / Vista (data)

Jan 26, 2007

I've been working all day with members at ubuntu forums, I need serious help please

ubuntuforums.org/showthread.php?p=2067895&posted=1#post206789

I restarted again in live boot mode of course and now when I go to computer I see the 104.8GB volume drive. (wasn't there before), this is the Windows partition

When I try to open it I get an error

unable to mount the selected volume
error: device /dev/sda2 is not removable
error: could not execute pmount

So I ran sudo mount /dev/sda2 /media/windows -t ntfs -r -o uid=999,gid=999,umask=444
and now I get "you do not have the permissions necessary to view the contents of 'windows'

View 1 Replies View Related

Sendmail/postfix On Ubuntu 7.04

Sep 9, 2007

how do I configure a minimal/basic sendmail/postfix mail server on an ubuntu 7.04 server edition? I tried with postfix but I ran only into errors.

View 1 Replies View Related

Ubuntu Or CentOS? (Or Some Other Distro?)

Jul 5, 2007

I've always used CentOS for my servers. But now there's this Ubuntu thing taking off!

Is Ubuntu taking off on the server side as well or is Rhat still king?

Is there a site where I can get % numbers for which distros are most popular (on servers, not desktop)?

(This is as a customer/admin not a hosting provider).

View 5 Replies View Related

Remote Ubuntu Server

Jul 26, 2007

I installed ubuntu server on my server

my os is windows xp

how may i remote to ubuntu by windows?

View 4 Replies View Related

How To Get BFD Or Antidos To Work On Ubuntu 5.10 / 6.06 --- Plesk 8?

Sep 18, 2006

Have been trying to get BFD and APF Antidos (not at same time) to work on Ubuntu 5.10 / Plesk and 6.06 (No Plesk yet) servers. APF appears to work fine after checking /sbin/iptables -L -n

Both cronjobs run but getting a lot of brute force attacks to ssh and Plesk but no offending IP's are being blocked and no e-mails reporting that they are being blocked. Log files for BFD and Antidos are always "0". Everything setup and configured the same as on my previous CentOS servers.

Can't find much on the net with this newer OS. Can anyone point me in the right direction to get one of these to work on the systems above? Thought it might be a path error referencing rc.d but put a symlink in for that and no change.

View 2 Replies View Related

Windows Server 2003 X86 Or Ubuntu 9.04 X64

Apr 28, 2009

The past week I've been trying to answer the hardest question. I'm an expert windows user and a Novice Linux user.

I have a server built and ready for an operating system, this will be a development server for database and web development. It will also likely turn into an encrypted file server as well.

I do not plan on doing much else other then that.

Is it worth it to struggle through and learn the Linux command line or should I go for Windows Server something I am more familiar with?

I've considered VMware although I have "Fake Raid" and ESXi does not see my Raid-1 setup.

View 6 Replies View Related

How To Configure Email On Linux Ubuntu

Jun 24, 2009

email configuring problem.

I have a complete 512mb vps on slicehost.com All configuring went well.

But for some reason I can't get my email-server to work. I have followed all tutorials on articles.slicehost.com/email Also I have installed atmail(.org) on my subdomain for email.

I always get the error the password isn't correct. Also when I try with Outlook.

The password is encrypted.

I understand an email setup is a complicated thing, and you probably need more information. But do you guys have any suggestions on what it might be? I'm a newbie, so it surely can be a newbie issue.

View 2 Replies View Related

How To Install A Zend Optimizer In Ubuntu

Mar 22, 2008

How to install a zend optimizer in ubuntu?

View 3 Replies View Related

How To Install Mod_security For Ubuntu Gutsy

Jan 14, 2008

Cant seem to find anywhere that has a tutorial or instructions on how to install mod security for ubuntu gutsy, has anyone installed it lately and like to share their experience or tell how? Ive google to try find answer about 4 times now in last 2 weeks and still havent found anything.

View 1 Replies View Related

Webhosting OS Centos Or Ubuntu (Debian)

Jun 22, 2008

I am currently using Ubuntu (debian) server 7.10 for web hosting but see a lot of discussions about Linux centos.

Which linux OS do you prefer for hosting and why....

Just figured I would throw that out there.

View 2 Replies View Related

Making Mailer On Ubuntu Server

Aug 8, 2007

I have a Ubuntu 6 LTS server, and so far i have installed and got working:
Apache, PHP5, SQL5

but now i come to EXIM, its installed, and i have installed Solid Pop3d as a pop server - it was in the repository, but now i dont know what to do.

The server exists as a subdomain of another, until its ready for me to move onto. There are no control panels, i wanted to do it all with SSH.

Does anyone know how to set it up so i can connect with a mail client, and how to setup accounts?

View 0 Replies View Related

Ubuntu + Apache 2.0 + PHP 5.2.1 - Cannot Use Dynamic Extensions (e.g. Pdo.so)

Mar 6, 2007

I'm trying to compile PHP 5.2.1 on my Ubuntu 6.10 server. I've downloaded the source code from php.net and am running the following configure command on it:

Code:
./configure --with-apxs2=/usr/bin/apxs2 --with-mysql --with-informix=/opt/informix --enable-shared --enable-pdo=shared --without-sqlite --without-pdo-sqlite --with-pdo-mysql=shared --with-zlib --with-xml --with-pdo-informix=shared,/opt/informix
After doing this, then make, I copy over the generated libphp5.so file into my Apache extensions directory, add extension=pdo.so (and lines for the PDO-MySQL/Informix extensions) into my php.ini and restart Apache. I would expect to see PDO, PDO-MySQL and PDO-Informix listed in my phpinfo() - but they don't appear.

So, I tried recompiling PHP but without any of the PDO extensions being shared. This worked, and I could see PDO and PDO-MySQL in phpinfo(), but not PDO-Informix.

So, can anyone hazard a guess as to why none of the PDO extensions load when compiled shared? I don't get any related error messages in the Apache or System logs by the way....

View 0 Replies View Related

Webmin On Ubuntu. What Account Should I Install It In

Jan 12, 2008

I am running ubuntu server 6.

I'm just wondering if I should install webmin under root using the sudo command or should I create seperate user space for it?

View 0 Replies View Related

Unable To Compile Apache Under Ubuntu

Jan 4, 2007

A little background on what I'm doing here...

I'm setting up a Linux machine specifically for use as a VNC here at work.

The IT Manager said he'd used Ubuntu before but left the distro up to me.

I set up my test machine with Ubuntu but need to compile Apache for portions of it to work. I've never had any problems building Apache before, but this is what I'm getting here. I have a feeling that, since I've not used Ubuntu before, that I'm just missing a step. I also noticed that the "make" command doesn't work. Does that need to be installed and compiled as well?

=========================================
root@vnc01:/etc/httpd-2.2.3# ./configure /usr/local/apache
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /usr/local/apache
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... /usr/local/apache
checking host system type... /usr/local/apache
checking target system type... /usr/local/apache

Configuring Apache Portable Runtime library ...

checking for APR... reconfig
configuring package in srclib/apr now
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /usr/local/apache
checking build system type... /usr/local/apache
checking host system type... /usr/local/apache
checking target system type... /usr/local/apache
Configuring APR library
Platform: /usr/local/apache
checking for working mkdir -p... yes
APR Version: 1.2.7
checking for chosen layout... apr
checking for /usr/local/apache-gcc... no
checking for gcc... no
checking for /usr/local/apache-cc... no
checking for cc... no
checking for cc... no
checking for /usr/local/apache-cl... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr
root@vnc01:/etc/httpd-2.2.3#

The config.log file doesn't honestly show any errors that I can see pertaining to any compile errors.

View 5 Replies View Related

Good Raid Cards For Ubuntu

May 20, 2007

With Ubuntu getting more and more popular, anyone knows what are the raid cards that support Ubuntu?

View 4 Replies View Related

Apache :: How To Start And Stop On Ubuntu

Sep 27, 2013

I have installed Apache on ubuntu as per our project related manual by using the packages.

httpd-2.4.4.tar.gz
apr-1.4.6.tar.gz
apr-util-1.5.2.tar.gz

I copied apr-1.4.6 apr-util-1.5.2 (after extract) to srclib directory of apr-util-1.5.2

and created symbolic links as below

ln _s apr-1.4.6 apr
ln _s apr-util-1.5.2 apr-util

and configured httpd-2.4.4 with
./configure --with-included-apr

and make ; make install;

now my apache is running , but how to stop and start the apache.

I googled for reference and found it can be done using

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start

I dont have apache2 in my /etc/init.d folder.

how to start and stop.

View 1 Replies View Related

Plesk 12.x / Linux :: MySQL 5.6 On Ubuntu 12.04?

Jun 7, 2015

I would like to Mysql 5.6 installed on Plesk 12. Is that possible? How does it work?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved