Tampilkan postingan dengan label Apache. Tampilkan semua postingan
Tampilkan postingan dengan label Apache. Tampilkan semua postingan

Selasa, 27 Januari 2015

Install mod_pagespeed in RHEL/CentOS/Fedora and Debian/Ubuntu linux


mod_pagespeed (Website speed optimizer) is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. It has several filters that automatically optimize files like HTML, CSS, JavaScript, JPEG, PNG and other resources.

Installing mod_pagespeed module for Apache in RHEL/CentOS/Fedora 32 and 64 bit


First install at:
#yum install at

Now download mod_pagespeed:
32 bit:
#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm

For installatio on RHEL/CentOS/Fedora, please execute (also as root):
#rpm -U mod-pagespeed-stable_current_i386.rpm

64 bit:

#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
#rpm -U mod-pagespeed-stable_current_x86_64.rpm

Installing mod_pagespeed module in Debian/Ubuntu

To install the packages, on Debian/Ubuntu, please run (as root) the following command:
32 bit:
#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb
#dpkg -i mod-pagespeed-stable_current_i386.deb
#apt-get -f install

64 bit:

#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
#dpkg -i mod-pagespeed-stable_current_amd64.deb
#apt-get -f install

Verifying mod_pagespeed Module for Apache

To verify mod_pagespeed module create info.php under root directory of Apache and add following lines of code to it.
Now,navigating your web browser to http://ip.add.re.ss/info.php. You will see “X-Mod-Pagespeed” section in the HTTP header.

How to Install MariaDB, Apache/PHP on RHEL/CentOS 7

This howto guide explains you’ll how to install Apache Server with latest MariaDB and PHP on RHEL, CentOS 7 linux using Remi repository via Yum tool.

Install REMI repository

First enable remi repository:
First enable remi repository:
#rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

Installing MariaDB (MySQL)
To install MySQL, we do install mariadb like this:
#yum -y install mariadb-server mariadb

Now, ceate the system startup links for MySQL and start the MySQL server:
#systemctl start mariadb.service
#systemctl enable mariadb.service

Set passwords for the MySQL root account:
Set passwords for the MySQL root account:
#mysql_secure_installation

[root@localhost ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): <--ENTER
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]
New password: <--yourmariadbpassword
Re-enter new password: <--yourmariadbpassword
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] <--ENTER
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <--ENTER
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] <--ENTER
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] <--ENTER
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]#

Install Apache server


CentOS 7.0 ships with apache 2.4. Apache2 is directly available as a CentOS 7.0 package, therefore we can install it like this:
#yum -y install httpd

Now, configure your system to start Apache at boot time:
#systemctl start httpd.service
#systemctl enable httpd.service

In CentOS 7.0 uses Firewall-cmd. Use following command to allow http and https external access.
#firewall-cmd --permanent --zone=public --add-service=http 
#firewall-cmd --permanent --zone=public --add-service=https
#firewall-cmd --reload

Now direct your browser to http://ip.add.re.ss/, and you should see the Apache2 placeholder page:
CentOS 7 default apache page
CentOS 7 default apache page

Installing PHP

We can install PHP width MySQL support and some common PHP modules that are required by CMS Systems like WordPress, Joomla and Drupal use following commands:
#yum -y install php php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
#nano /var/www/html/info.php

Now we call that file in a browser (e.g. http://ip.add.re.ss/info.php):

Example info.php page