Installing Apache, MySql, and PHP on fedora

+–[ ** MySql ** ]
|
|–installion
|#yum install mariadb mariadb-server
|–activated service
|#systemctl start mariadb.service
|#service mysqld start
|–secure installation for first use
|#mysql_secure_installation
|–auto start at boot
|#chkconfig –levels 235 mysqld on
|–enable remote connection
| ___________________________
|| +
||-edit /etc/sysconfig/iptables
||add –>[ -A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT ]
||___________________________+
| |___ for centos/redhat
| ___________________________
|| +
||#firewall-cmd –permanent –zone=public –add-service=mysql
||–or–
||#firewall-cmd –permanent –zone=public –add –port=3306/tcp
||___________________________+
| |___ for fedora
|
|#service iptables restart
|____________________________+
|
|
|–[ ** Aphache ** ]
|–installation
|#yum install httpd php-common
|–activated service
|#systemctl start httpd.service
|#service httpd start
|–auto start at boot
|#chkconfig –levels 235 httpd on
|–enable remote connection
| ___________________________
|| +
||-edit /etc/sysconfig/iptables
||add –>[ -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT ]
||___________________________+
| |___ for centos/redhat
| ___________________________
|| +
||#firewall-cmd –permanent –zone=public –add-service=http
||–or–
||#firewall-cmd –permanent –zone=public –add –port=80/tcp
||___________________________+
| |___ for fedora
|
|#service iptables restart
|____________________________+
|
|
|–[ ** PHP5 ** ]
|–installation
|#yum install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
|____________________________+
|
|
|–[ ** Enabled Apache Userdir ]
| — edit userdir.conf
||
||
|| #
|| # UserDir is disabled by default since it can confirm the presence
|| # of a username on the system (depending on home directory
|| # permissions).
|| #
|| UserDir enabled testuser
||
|| #
|| # To enable requests to /~user/ to serve the user’s public_html
|| # directory, remove the “UserDir disabled” line above, and uncomment
|| # the following line instead:
|| #
|| UserDir public_html
||
||
||
||
|| Options Indexes Includes FollowSymLinks
||
|| ## Apache 2.4 users use following ##
|| Require all granted
||
|| ## Apache 2.2 users use following ##
|| AllowOverride All
|| Allow from all
|| Order deny,allow
||
||____________________________+
| |___ #vi /etc/httpd/conf.d/userdir.conf
|
|–create public_html directory
|#mkdir /home/user/public_html
|
|–change permissions
|#chmod 711 /home/user
|#chown user:user /home/user/public_html
|#chmod 755 /home/user/public_html
|
|–set selinux policy for user home dir
|#setsebool -P httpd_enable_homedirs true

Advertisements
This entry was posted in linux, php and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s