CentOS 5: Installing XAMPP, and Gallery2

1. Install CentOS 5
– Do not install MySQL, Apache, and FTP
– edit /etc/resolv.conf to point nameserver to 192.168.1.254 (your webserver IP)
– disable auditd to prevent system crashes!
 
2. Install XAMPP
– http://www.apachefriends.org/en/xampp-linux.html#377
cd /
tar xvfz xampp-linux-1.6.2.tar.gz -C /opt
/opt/lampp/lampp start
 
3. Activate eAccelerator
– Edit /opt/lampp/etc/php.ini at “eAccelerator” lines grouping
– Remove the “;” at the beginning of each line and restart XAMPP
 
4. Install “j2sdk-1_4_2_14- linux-i586.bin” for Java support
– Download from http://java.sun.com/j2se/1.4.2/download.html; place inside /opt/lampp
– Change permission of “j2sdk-1_4_2_14- linux-i586.bin”
cp j2sdk-1_4_2_14-linux-i586.bin /opt/lampp
cd /opt/lampp
./j2sdk-1_4_2_14-linux-i586.bin
ln -s j2sdk1.4.2_14 java
 
5. Install “xampp_tomcat-5.0.27-addon-0.3.tar.gz” for Java server
– Download from http://addons.xampp.org/
cp xampp_tomcat-5.0.27-addon-0.3.tar.gz /opt/lampp
cd /opt/lampp
tar xvzf xampp_tomcat-5.0.27-addon-0.3.tar.gz -C /opt
– Edit: “/opt/lampp/conf/workers2.properties” – [uri: sexcenter.dyndns.org/*.jsp]
/opt/lampp/lampp start
/opt/lampp/lampp usetomcat
– http://sexcenter.dyndns.org:8080/
– log-on using xampp, xampp -> change password to seanofdoor
 
6. Install “xampp_mod_xslt-2.0.4-addon-0.1.tar.gz” for sxml support
– Download file onto /opt/lampp
/opt/lampp/lampp stop
cd /opt/lampp
tar xvzf xampp_mod_xslt-2.0.4-addon-0.1.tar.gz -C /opt
– Add the following line to “httpd.conf”: Include etc/mod_xslt.conf
/opt/lampp/lampp stop
– http://your.domain/mod_xslt/book.xml – should see something
 
– Note: libxml2 is too old – Open “libxml2-2.6.16-1.1.rf.x86_64.rpm”; Extract /./usr/lib64/ “libxml2.so.2” and “libxml2.so.2.6.16” into /opt/lampp/lib
 
4. Use phpMyAdmin to create user and database
– Create user=sexcenter, password=seanofdoor
– Choose automatically create ‘sexcenter’ database with all priviledges to new user
 
6. Set XAMPP to run at default
– Find out your default runlevel
– [root@localhost ~]# egrep :initdefault: /etc/inittab
– Result: id:5:initdefault:
– Go into the directory which configures this runlevel
– [root@localhost ~]# cd /etc/rc.d/rc5.d
– [root@localhost ~]# ln -s /opt/lampp/lampp S99lampp
– [root@localhost ~]# ln -s /opt/lampp/lampp K01lampp
 
4. Create mySQL database
– database = sexcenter
– username = sexcenter
– password = seanofdoor
 
5. Install Dolphin
– Download Dolphin 6 | Extract to htdocs/sexcenter
– Shell prompt # cd /opt/lampp/htdocs/sexcenter
– Shell prompt # chmod -v 777 backup cache inc langs media/images/banners media/images/blog media/images/gallery media/images/profile media/images/profile_bg media/images/sdating media/sound media/video periodic tmp groups/gallery media/images inc/header.inc.php periodic/periodic.file
– Shell prompt # chmod -v 666 periodic/cmd.php periodic/notifies.php periodic/tags.php ray/modules/global/inc/header.inc.php ray/modules/global/inc/cron.inc.php ray/modules/global/js/integration.js inc/params.inc.php ray/modules/im/js/invite.js orca/inc/header.inc.php inc/menu_content.inc.php
 
5. Secure XAMPP
– [root@localhost ~]# /opt/lampp/lampp security
– Set all passwords to “seanofdoor”
– XAMPP user=LAMPP, password=seanofdoor
 
———————————————————————————————
7. Install “Webmin”
– Download “webmin-1.350.tar.gz” into /
– Shell prompt # gunzip webmin-1.350.tar.gz
– Shell prompt # tar -xvf webmin-1.350.tar
– Shell prompt # cd webmin-1.350
– Shell prompt [/webmin- 1.350]# ./setup.sh /var/webmin
– [set all settings] – My pick username=root password=seanofdoor
 
 
9. Install Gallery2
– download Gallery2
– Create Gallery2 database with UTF_8_CI collation, give sexcenter user full access
– /opt/lampp/etc/php.ini, change memory_limit to 64M
/opt/lampp/lampp restart
– Create “gallery69” under /opt/lampp/gallery69
– chmod 777 /opt/lampp/gallery69 <== this shall be the directory
– Run ~/install, let the gallery be “gallery69” path
cd /opt/lampp/htdocs/sexcenter/xxx
touch config.php
chmod 666 config.php
– admin=sexcenter, pwd=spectrumpharmaceuticals*
– Finish step 10 to get this:
Install Plugins
    * The Ffmpeg module was installed, but needs configuration to be activated
    * The ImageMagick module was installed, but needs configuration to be activated
    * The Multiroot module was installed, but needs configuration to be activated
    * The Nokia Image Upload module was installed, but needs configuration to be activated
    * The URL Rewrite module was installed, but needs configuration to be activated
 
chmod 644 /opt/lampp/htdocs/sexcenter/xxx/config.php
 
– Change logo in here
/opt/lampp/htdocs/sexcenter/xxx/images/galleryLogo_sm.gif
 
10. Install ffmpeg for movie streaming
– download from http://bogdan.org.ua/wp-content/uploads/2007/06/ffmpeg
– put it in /opt/lampp/bin/ffmpeg
chmod 755 /opt/lampp/bin/ffmpeg
– run Gallery Site Admin and install ffmpeg mod
 
 
—————————————————————————————-
Optional: Install PHP-GD (optional if you want base CentOS default Apache – not installing XAMPP)
– Shell prompt # yum list *gd*
– Shell prompt # yum install php-gd.x86_64
– enter “yes” to download package
– Shell prompt # service httpd restart
———————————————————————————-
Step 1: Creating the backup
Create the backup by calling:
 
/opt/lampp/lampp backup
or
/opt/lampp/lampp backup secret
 
Where secret is your MySQL root password.
 
Step 2: Take care of your backuped data
The file /opt/lampp/backup/xampp-backup-22-01-04.sh (in the example above) contains your backuped data. Get this file to a save place.
Step 3: Restore your backuped data
On the new machine you need the same version of XAMPP as on your original/source machine.
 
Call (as root):
 
sh xampp-backup-22-01-04.sh
 
You shoud see something like this:
 
# sh xampp-backup-22-01-04.sh
Checking integrity of files…
Restoring configuration, log and htdocs files…
Checking versions…
Installed: XAMPP 1.4.2
Backup from: XAMPP 1.4.2
Restoring MySQL databases…
Restoring MySQL user databases…
Backup complete. Have fun!
You may need to restart XAMPP to complete the restore.
#
 
——————————————————–
 
To uninstall XAMPP just type in this command:
 
rm -rf /opt/lampp
 
——————————————————–
 
To kill bad processes
ps aux | grep httpd (to filter processes matching httpd)
kill -15 httpd (-9 is forceful)
 
——————————————————–
IPTABLES
 
iptables -I INPUT -s 124.240.120.99 -j DROP
iptables -L -n
 
# to delete rule
iptables -D INPUT -s x.x.x.x -j DROP
# check iptables -L -n
 
—————————————————
# Reboot server every other day of every month
crontab
0 3 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29 * * /sbin/shutdown -r
# Control + D
 
 – Shell prompt # yum list *gd*
– Shell prompt # yum install php-gd.x86_64
– enter “yes” to download package
– Shell prompt # service httpd restart
Optional: install ImageMagick (for Gallery2)
yum list *imagemagick*
yum install ImageMagick.x86_64
yum list *ffmpeg*
yum install ffmpeg
 
Optional: install dcraw and gd (for Gallery2)
yum install dcraw.x86_64
yum install gd.x86_64
 
Optional: get a pre-compiled ffmpeg
cd /opt/lampp/bin
wget http://bogdan.org.ua/wp-content/uploads/2007/06/ffmpeg
chmod 755 /opt/lampp/bin/ffmpeg
 
Change ownership of all files in htdocs to nobody
chown -R nobody /opt/lampp/htdocs

Older Notes:

Installing XAMPP
cd /opt/lampp/
wget http://www.apachefriends.org/download.php?xampp-linux-1.6.7.tar.gz
su
tar xvfz xampp-linux-1.6.7.tar.gz -C /opt
/opt/lampp/lampp php5
/opt/lampp/lampp security
/opt/lampp/lampp start
 
Activate e-accelerator:
vi /opt/lampp/etc/php.ini
—————————————
;extension=”eaccelerator.so”
;eaccelerator.shm_size=”16″
;eaccelerator.cache_dir=”/opt/lampp/tmp/eaccelerator”
;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″
——————————————
Remove the semicolon at the beginning of each line and restart XAMPP. eAccelerator is now active. For more information about eAccelerator, check the eAccelerator home page:
 
SECURITY:
 
When FTP is not in use, disable it to close this insecure protocol:
/opt/lampp/lampp stopftp
XAMPP does not provide a direct script to modify Apache’s httpd.conf to make the change so you’ll have to dig into the file directly yourself. The change is made in the ServerToken section of httpd.conf. XAMPP by default has it set at “Full” which send all the version information about Apache and the various compiled modules. Change the entry to “Prod” which offer the least level of detail and will only reveal that Apache (not the version is running).
So instead of having your server report-“Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7d PHP/5.0.4 DAV/2 mod_perl/1.999.21 Perl/v5.8.6 Server at hostname/ Port “–which is a veritable buffet for a hacker you simply get “Apache Server at hostname/ Port” which makes target enumeration significantly more difficult.
 
IMPORTANT FILES AND DIRECTORIES
File/Directory Purpose
 
 
/opt/lampp/bin/ The XAMPP commands home. /opt/lampp/bin/mysql calls for example the MySQL monitor.
 
 
/opt/lampp/htdocs/ The Apache DocumentRoot directory.
 
 
/opt/lampp/etc/httpd.conf The Apache configuration file.
 
 
/opt/lampp/etc/my.cnf The MySQL configuration file.
 
 
/opt/lampp/etc/php.ini The PHP configuration file.
 
 
/opt/lampp/etc/proftpd.conf The ProFTPD configuration file. (since 0.9.5)
 
 
/opt/lampp/phpmyadmin/config.inc.php The phpMyAdmin configuration file.
 
 
 

Step 1: Creating the backup

Create the backup by calling:
/opt/lampp/lampp backup
or
/opt/lampp/lampp backup secret
Where secret is your MySQL root password.
 
 

Step 2: Take care of your backuped data

The file /opt/lampp/backup/xampp-backup-22-01-04.sh (in the example above) contains your backuped data. Get this file to a save place.

Step 3: Restore your backuped data

On the new machine you need the same version of XAMPP as on your original/source machine.
Call (as root):
sh xampp-backup-22-01-04.sh
 
That’s all. As you can read you may need to restart XAMPP.
 
————————————————————————————————————–
To uninstall XAMPP just type in this command:
rm -rf /opt/lampp
 
 
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *