Showing posts with label Web_Server. Show all posts
Showing posts with label Web_Server. Show all posts
Monday, 11 July 2016
Thursday, 3 December 2015
How to Install Lamp on Centos 7
Install Lamp on Centos 7
1. Install Apache:# yum -y install httpd httpd-devel
2. Edit httpd.conf file:
# vi /etc/httpd/conf/httpd.conf
add this last line-
RewriteEngine on
CheckCaseOnly On
----Save & Quit (:wq)----
3. make logs directory:
# mkdir /logs
4. Go to /var/www/html :
# vi index.html
Make A HTML
add those line...
<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>
----Save & Quit (:wq)----
5. Install MySQL Database Server:
# yum install wget
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
# yum install -y mysql-server mysql mysql-devel
6. Start Mysqld Service:
# systemctl restart mysqld
7. Changing MySQL Root Password:
# mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
8. Check by logging in:
# mysql -u root -p
Enter Password: <your new password>
mysql> show databases;
+--------------------------------+
| Database |
+---------------------------------+
| information_schema |
| mysql |
+---------------------------------+
2 rows in set (0.00 sec)
mysql> exit
9. Install PHP5 Scripting Language:
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
# yum install -y php56w php56w-cli php56w-mysql php56w-pdo php56w-pecl-memcache php56w-xml php56w-imap php56w-mbstring php56w-mcrypt php56w-common php56w-fpm php56w-odbc php56w-devel php56w-xmlrpc php56w-soap php56w-pecl-igbinary php56w-pdo php56w-ldap php56w-xml php56w-imap php56w-pear php56w-gd
10. Create a file named /var/www/html/info.php:
# vi /var/www/html/info.php
<?php
phpinfo();
?>
----Save & Quit (:wq)----
11. Restart Apache to load php:
# systemctl restart httpd
12. Then point your browser to http://ip address/info.php:
Ex- http://192.168.72.249/info.php
13. Download this phpMyAdmin rpm:
# cd /var/www/html
# wget https://files.phpmyadmin.net/phpMyAdmin/4.4.10/phpMyAdmin-4.4.10-english.tar.gz
14. Extract the tar File & Rename it :
# tar -zxvf phpMyAdmin-4.4.10-english.tar.gz
# mv phpMyAdmin-4.4.10-english phpmyadmin
15. Edit the /etc/httpd/conf/httpd.conf File :
# vi /etc/httpd/conf/httpd.conf
Add those Lines : (line number 158)
<Directory /var/www/html/phpmyadmin>
Options -Indexes +Multiviews +FollowSymLinks
DirectoryIndex index.php index.html
AllowOverride All
Allow from all
</Directory>
----Save & Quit (:wq)----
16. Rename the config.sample.inc.php File :
#cd /var/www/html/phpmyadmin
# mv config.sample.inc.php config.inc.php
17. Now needs a secret passphrase (blowfish_secret):
# vi /var/www/html/phpmyadmin/config.inc.php
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Just Add Password - $cfg['blowfish_secret'] = 'Your Password but wrong pass'
$cfg['blowfish_secret'] = 'wron pass'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$cfg['Servers'][$i]['host'] = 'MySQL_Server_Name'; ← Database Server Hostname.
----Save & Quit (:wq)----
18. Start the httpd & mysql Service & stop iptables :
# systemctl enable httpd
# systemctl enable mysqld
# systemctl stop firewalld.service
and stop selinux
19. Point your browser to: http://ip.address/phpmyadmin :
ex- http://192.168.72.249/phpmyadmin
User Name: root
Password: Mysql_Password
---- DONE,Thanks ----
Tuesday, 1 December 2015
How To Install Apache Web Server on Centos/RHEL
How To Install Apache Web Server on Centos/RHEL
1. Install Apache:
# yum -y install httpd httpd-devel
2. Edit httpd.conf file:
# vi /etc/httpd/conf/httpd.conf
#ServerName www.example.com:80
Just Add this Line-
ServerName ip address of server:80
Check this Line-991
NameVirtualHost *:80
Last-add this line-
DocumentRoot "/var/www/html"
add this last line-
RewriteEngine on
CheckCaseOnly On
----Save & Quit (:wq)-----
make logs directory...
#mkdir /logs
3. Go to /var/www/html :
# vi index.html
Make A HTML
add those line...
<html>
<marquee direction="left">
<font size="12" color="red">
!!!....Restricted zone....!!!
</font>
</marquee>
</html>
----Save & Quit (:wq)----
# vi /etc/httpd/conf.d/192.168.100.251.conf
then paste those line
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin deb.mind009@gmail.com
ServerName 192.168.100.251
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html
DocumentRoot /var/www/html
# Custom log file locations
LogLevel warn
ErrorLog /logs/192.168.100.251-error_log
SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
CustomLog /logs/192.168.100.251-access_log combined Env=!DontLog
</VirtualHost>
----Save & Quit (:wq)----
# vi /etc/httpd/conf.d/debojyoti.com.conf (FOR VIRTUAL HOSTS)
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin deb.mind009@gmail.com
ServerName www.debojyoti.com
ServerAlias debojyoti.comi
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php index.html
DocumentRoot /var/www/html/debojyoti.com
# Custom log file locations
LogLevel warn
ErrorLog /logs/debojyoti.com-error_log
SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|js?.|css?.)$" DontLog
CustomLog /logs/debojyoti.com-access_log combined Env=!DontLog
</VirtualHost>
----Save & Quit (:wq)----
4. Start httpd Service:
# /etc/init.d/httpd start
------ DONE,Thanks-------
How to Install Tomcat7 on Centos/RHEL 6.X
Install Tomcat7 on Centos/RHEL
Make sure apache configuration is done.
Step 1. Install JAVA
# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
# yum install jdk-8u5-linux-x64.rpm
# java -version
# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME
# vi /etc/profile.d/java.sh
#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.
save and exit
# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh
# java -version
Step 2: Download and Extract Tomcat Archive
# cd /tmp
# wget http://psg.mtu.edu/pub/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz
# tar -zxvf apache-tomcat-7.0.57.tar.gz
# mv apache-tomcat-7.0.57 /usr/local/tomcat7
Step 3. Add the init scripts for it.
# vi /etc/init.d/tomcat
#!/bin/bash
# description: Tomcat Start Stop Restart-SOM
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.8.0_05
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/local/tomcat7
case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
save and exit
# chmod 755 /etc/init.d/tomcat
Step 4 . Start the tomcat as a service.
# service tomcat start
# chkconfig tomcat on
Step 5. Access Tomcat in Browser
http://ipaddress:8080 OR http://hostname:8080
Step 6. Setup User Accounts. Paste inside <tomcat-users> </tomcat-users> tags.
# vi /usr/local/tomcat7/conf/tomcat-users.xml
<role rolename="manager-gui" />
<user username="manager" password="redhat" roles="manager-gui" />
<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="nasant" roles="manager-gui,admin-gui" />
save and exit.
# service tomcat restart
# service httpd restart
----- DONE,Thanks -----











