Bekijk Volledige Versie : Apache 2, PHP4-PHP5 & MySQL5
Beste WHT'ers,
Ik wil deze zaterdag in de nacht Apache 2, PHP4-PHP5 & MySQL5 installeren!
Hoe zou ik Apache 2 en MySQL5 het beste installeren zonder dat ik problemen krijg!
Ik heb nu PHP4 maar naast die wil ik ook PHP5 ook gebruikenj. Om php5 te gebruiken moet je dan bestand.php5 schrijven maar hoe zou ik dit moeten doen?
Alvast Bedankt!
't ligt er volkomen aan op welk besturingssysteem je het van plan bent.
Voor Windows kan je XAMPP gebruiken, voor Linux kan je soms RPM's of DEB files gebruiken, ligt eraan welke distro je hebt...
Je kan PHP4 naast PHP5 draaien. PHP5 draait dan als apache-module en php4 als cgi-module.
PowerSp00n
12/04/06, 16:57
Gezien je het in de nacht gaat doen lijkt het erop dat je het op een productie systeem gaat doen, lijkt het je dan niet verstandiger om de installatie eerst eens ergens op een test machine te proberen? Met google kun je er verder ook veel over vinden hoe je dit kunt doen...
Er draait een paar site's van mij en een klant! Ik heb op dit moment maar 1 server!
ErikKosters
12/04/06, 17:56
Dan nog, je wilt toch uptime garanderen? :) Zou het ook eerst thuis op een computertje proberen.
Zeker UPTime heeft altijd bij mij voorrang
Werkt Apache 2, PHP5 & MySQL5 wel met DA?
Niet lullig bedoeld, maar weet je wel waar je mee bezig bent? "Even installeren", terwijl je geen idee hebt?
Anyway: het is mij gelukt onder debian met de volgende sourcces.list:
diedx:~# cat /etc/apt/sources.list
# sources.list generated by apt-spy v3.1
deb http://ftp.surfnet.nl/os/Linux/distr/debian/ testing main
deb http://ftp.surfnet.nl/os/Linux/distr/debian/ stable main
deb-src http://ftp.surfnet.nl/os/Linux/distr/debian/ testing main
deb http://security.debian.org/ stable/updates main
#deb http://people.debian.org/~dexter php5 woody
# Onderstaand voor amavis!
#deb ftp://debian.marlow.dk/ woody virus
#Onderstaand voor PHP5
#deb http://packages.dotdeb.org ./
#deb-src http://sources.dotdeb.org ./
#deb http://www.backports.org/debian/ dists/stable/python-mysqldb/binary-i386/
#deb http://www.backports.org/debian/ woody spamassassin
#deb http://www.backports.org/debian/ dists/stable/dovecot/binary-i386/
# Nodig voor Apache2
#deb http://www.backports.org/ debian/dists/stable/apache2/binary-i386/
deb http://secure-testing.debian.net/debian-secure-testing etch/security-updates main contrib non-free
deb-src http://secure-testing.debian.net/debian-secure-testing etch/security-updates main contrib non-free
#deb http://quozl.netrek.org/pptp/pptpconfig ./
# Oracle!!!
deb http://oss.oracle.com/debian unstable main non-free
diedx:~#
(En ja, veel shit wat er tussen staat :))
Have fun!
jinxedworld
15/04/06, 15:34
@diedx
Da's een mooie oplossing, echter, DA werkt niet met de Debian packages, maar compiled alles zelf vanaf source, zo ook PHP. Ik denk dus niet dat dit voor een DA-bak gaat werken. PHP4 óf PHP5 werken prima op DA, maar én php4 én php5 durf ik niet te zeggen, op het DA forum waren ze er in ieder geval nog niet helemaal uit. Onderstaande heb ik van het DA forum afgeplukt, een oplossing met een 2e apache instance op poort 81 en mod_proxy om door te sluizen:
ugh, I finally managed to run PHP4 and PHP5 (as apache modules) on the same machine with 2 apache processes. The second process listening port 81 and using mod_rewrite to transparently redirect requests from one server to the other (port 80 to port 81). Using mod_rewrite means I can decide to run PHP4 or PHP5 per directory.
However, it's quite tricky and very difficult to maintain.
More or less, this is what I did:
1. I was already running Apache 1.3.x and PHP4 (on a RedHat box).
2. wget PHP5 into the customapache dir.
3. Copy build to build.php5 and configure.php to configure.php5
Edit build.php5 to set the PHP version to 5.0.4
Edit configure.php5 and add the following parameters:
--prefix=/usr/local/php5 \
--exec-prefix=/usr/local/php5 \
Note 1: This way I can use build to deal with PHP4 and build.php5 to deal with PHP5.
Note 2: PHP4 and PHP5 get installed in different directories. Location of php.ini files:
PHP4: /usr/local/lib/php.ini
PHP5: /usr/local/php5/lib/php.ini
4. Create a copy of the httpd binary
cd /usr/sbin
cp httpd httpd.php5
5. Create a new startup script for the second Apache service:
cd /etc/rc.d/init.d
cp httpd httpd.php5
Edit httpd.php5 to make it use the new binary and different .lock and .pid files.
Also added the following argument to the httpd startup command:
-f /etc/httpd/conf/httpd.php5.conf
6. Create a new set of .conf files for the second Apache process
cd /etc/httpd/conf
cp ips.conf ips.php5.conf
cp httpd.conf httpd.php5.conf
Edit the new .conf files to remove all references to port 443 (I didn't wanted SSL) and changing all references to port 80 to use port 81.
Removed all Includes from the bottom of the httpd.php5.conf file to avoid setting up all domains/subdomains for the second Apache service.
Insert the Virtual Hosts corresponding to the domains/subdomains that I wish to use PHP5 and make them use port 81 (remove VHosts corresponding to SSL).
Make sure httpd.conf loads the PHP4 module and httpd.php5.conf loads the PHP5 module.
Edit httpd.conf and make it load the mod_proxy module. Also added the following statemenst to make sure it is disabled by default:
<IfModule mod_proxy.c>
ProxyRequests Off
</IfModule>
7. Finally, in the documents root of those domains I wish to use PHP5 create an .htaccess file to redirect requests from port 80 to port 81.
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$ [NC]
RewriteCond %{REQUEST_FILENAME} ^(.*).php$ [NC]
RewriteRule (.*) http://www.example.com:81/$1 [P,L]
Note the use of the [P] flag. This is the Proxy Throughput feature of mod_rewrite. It requires mod_proxy installed on the first Apache service.
Well, I did it just to test PHP5 on my server. I don't think it can be used on a production server. Too tricky and very difficult to maintain
http://directadmin.com/forum/showthread.php?threadid=8641
VMware niet ff een oplossing?
http://www.howtoforge.com/apache2_with_php5_and_php4
jinxedworld
15/04/06, 17:21
Tsja, da's dus hetzelfde wat niet gaat werken met DirectAdmin om de reden die ik hierboven heb gegeven.
weet goed waar je aan gaat beginnen, DirectAdmin (en Plesk ook trouwens) werkt maat zo-zo met Debian, dus daar aan sleutelen is een verhoogd risico als je niet zo thuis bent in die zaken!
Bedankt voor jullie info...dan laat ik het maar effe zitten!