shadowmac Posted August 7, 2009 Share Posted August 7, 2009 APACHE WEB SERVER Apache Web Server is already installed and you can confirm it's installed by going to Webmin (https://youripaddress:10000) Login (probably with root) MYSQL DATABASE SERVER Again, another easy task using Webmin. Once you log into webmin as discussed previously, click on Un-used Modules - MySQL Database Server and click on the link that will install using Yum Once finished installing MySql Database Server you will be prompted with a link at the bottom of the screen that states something like Return to MySQL Database Server. Click the link to continue. Click on Start MySQL Server which runs the command /etc/rc.d/init.d/mysqld start Once MySQL starts successfully, you will now see the management screen for MySQL. If not, while in Webmin, click on Servers then click on MySQL Database Server. Click on MySQL System Variables and search for ‘port’ and you'll find the port number that MySQL is using. Typically 3306 Now that the MySQL database server is installed we just need to 'start' the server and then make sure that we configure it to 'autostart' when system is rebooted for any reason. Run the following commands from shell access # chkconfig --level 23 mysqld on# chkconfig --list mysqld NOTE: the 2 and 3 are Unix run level settings rc2.d - Single User Mode with Networking rc3.d - Multi-User Mode - boot up in text mode Set MySQL Admin passwordmysqladmin -u root password yourrootsqlpasswordmysqladmin -h server1.example.com -u root password yourrootsqlpasswordPHPRun the following commands from shell access to install PHP 5 #yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel OR rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txtcd /tmpwget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpmrpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpmyum install ntp httpd mysql-server php php-mysql php-mbstring php-mcrypt phpmyadmin rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel NOTE: If you receive YUM errors, its more then likely because of mysqld and memory (especially if you are in a VPS). easiest way to solve this is to stop mysqld service.Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the stanza): vi /etc/httpd/conf.d/phpmyadmin.conf ## Web application to manage MySQL### Order Deny,Allow# Deny from all# Allow from 127.0.0.1#Alias /phpmyadmin /usr/share/phpmyadminAlias /phpMyAdmin /usr/share/phpmyadminAlias /mysqladmin /usr/share/phpmyadmin Next we change the authentication in phpMyAdmin from cookie to http: vi /usr/share/phpmyadmin/config.inc.php /* Authentication type */$cfg['Servers'][$i]['auth_type'] = 'http'; Then we create the system startup links for Apache and start it: chkconfig --levels 235 httpd on/etc/init.d/httpd start Now you can direct your browser to http://youripaddress/phpmyadmin/ or and log in with the user name root and your new root MySQL password. To install amavisd-new, spamassassin and clamav, run the following command:yum install amavisd-new spamassassin clamav clamd unzip bzip2 unrar perl-DBD-mysqlThen we start freshclam, amavisd, and clamd...chkconfig --levels 235 amavisd onchkconfig --levels 235 clamd on/usr/bin/freshclam/etc/init.d/amavisd start/etc/init.d/clamd start... and create some necessary directories:mkdir /var/run/amavisd /var/spool/amavisd /var/spool/amavisd/tmp /var/spool/amavisd/dbchown amavis /var/run/amavisd /var/spool/amavisd /var/spool/amavisd/tmp /var/spool/amavisd/dbISPConfig 3 allows you to use mod_php, mod_fcgi/PHP5, cgi/PHP5, and suPHP on a per website basis.mod_fcgid is not available in the official CentOS repositories, but there's a package for CentOS 5.x in the centos.karan.org testing repository. We enable the repository as follows:cd /etc/yum.repos.d/wget http://centos.karan.org/kbsingh-CentOS-Extras.repoNext we open /etc/yum.repos.d/kbsingh-CentOS-Extras.repo...vi /etc/yum.repos.d/kbsingh-CentOS-Extras.repo... and set gpgcheck to 0 and enabled to 1 in the section: name=CentOS.Karan.Org-EL$releasever - Testinggpgcheck=0gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txtenabled=1baseurl=http://centos.karan.org/el$releasever/extras/testing/$basearch/RPMS/ yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-mbstring php-mcrypt php-mhash php-mssql php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-develNext we open /etc/php.ini...vi /etc/php.ini... and change the error reporting (so that notices aren't shown any longer) and add cgi.fix_pathinfo = 1 at the end of the file: ;error_reporting = E_ALLerror_reporting = E_ALL & ~E_NOTICEcgi.fix_pathinfo = 1 Next we install suPHP:cd /tmpwget http://suphp.org/download/suphp-0.7.1.tar.gztar xvfz suphp-0.7.1.tar.gzcd suphp-0.7.1/./configure --prefix=/usr --sysconfdir=/etc --with-apr=/usr/bin/apr-1-config --with-apxs=/usr/sbin/apxs --with-apache-user=apache --with-setid-mode=owner --with-php=/usr/bin/php-cgi --with-logfile=/var/log/httpd/suphp_log --enable-SUPHP_USE_USERGROUP=yesmakemake installThen we add the suPHP module to our Apache configuration... vi /etc/httpd/conf.d/suphp.conf LoadModule suphp_module modules/mod_suphp.so ... and create the file /etc/suphp.conf as follows: vi /etc/suphp.conf ;Path to logfilelogfile=/var/log/httpd/suphp.log;Loglevelloglevel=info;User Apache is running aswebserver_user=apache;Path all scripts have to be indocroot=/;Path to chroot() to before executing script;chroot=/mychroot; Security optionsallow_file_group_writeable=trueallow_file_others_writeable=falseallow_directory_group_writeable=trueallow_directory_others_writeable=false;Check wheter script is within DOCUMENT_ROOTcheck_vhost_docroot=true;Send minor error messages to browsererrors_to_browser=false;PATH environment variableenv_path=/bin:/usr/bin;Umask to set, specify in octal notationumask=0077; Minimum UIDmin_uid=100; Minimum GIDmin_gid=100;Handler for php-scriptsx-httpd-suphp="php:/usr/bin/php-cgi";Handler for CGI-scriptsx-suphp-cgi="execute:!self" Finally we restart Apache: /etc/init.d/httpd restart PureFTPd can be installed with the following command: yum install pure-ftpd Then create the system startup links and start PureFTPd: chkconfig --levels 235 pure-ftpd on/etc/init.d/pure-ftpd start JOOMLA 1.5 Quote Link to comment Share on other sites More sharing options...
wildweaselmi Posted April 7, 2011 Share Posted April 7, 2011 Your server has a single IP address, and multiple aliases (CNAMES) point to this machine in DNS. You want to run a web server for www.example1.com and www.example2.org on this machine. Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names. You must have the names in DNS, resolving to your IP address, or nobody else will be able to see your web site. You can put entries in your hosts file for local testing, but that will work only from the machine with those hosts entries. # Ensure that Apache listens on port 80 Listen 80 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 DocumentRoot /www/example1 ServerName www.example1.com # Other directives here DocumentRoot /www/example2 ServerName www.example2.org # Other directives here The asterisks match all addresses, so the main server serves no requests. Due to the fact that www.example1.com is first in the configuration file, it has the highest priority and can be seen as the default or primary server. That means that if a request is received that does not match one of the specified ServerName directives, it will be served by this first VirtualHost. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.