[root@localhost /]# systemctl enable httpd
created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
查看apache状态
[root@localhost /]# systemctl status httpd
● httpd.service - the apache http server
loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
active: active (running) since 五 2017-07-21 17:21:37 cst; 6min ago
docs: man:httpd(8)
man:apachectl(8)
main pid: 2449 (httpd)
status: "total requests: 11; current requests/sec: 0; current traffic: 0 b/sec"
cgroup: /system.slice/httpd.service
├─2449 /usr/sbin/httpd -dforeground
├─2450 /usr/sbin/httpd -dforeground
├─2451 /usr/sbin/httpd -dforeground
├─2452 /usr/sbin/httpd -dforeground
├─2453 /usr/sbin/httpd -dforeground
├─2454 /usr/sbin/httpd -dforeground
├─2493 /usr/sbin/httpd -dforeground
├─2494 /usr/sbin/httpd -dforeground
└─2495 /usr/sbin/httpd -dforeground
7月 21 17:21:35 nmserver-7.test.com systemd[1]: starting the apache http server...
7月 21 17:21:36 nmserver-7.test.com httpd[2449]: ah00558: httpd: could not reliably determine the server's fully q...ssage
7月 21 17:21:37 nmserver-7.test.com systemd[1]: started the apache http server.
hint: some lines were ellipsized, use -l to show in full.
[root@localhost /]# netstat -tulp
active internet connections (only servers)
proto recv-q send-q local address foreign address state pid/program name
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* listen 1084/sshd
tcp 0 0 0.0.0.0:mysql 0.0.0.0:* listen 9760/mysqld
tcp6 0 0 [::]:ssh [::]:* listen 1084/sshd
tcp6 0 0 [::]:http [::]:* listen 2449/httpd
udp 0 0 localhost:323 0.0.0.0:* 592/chronyd
udp6 0 0 localhost:323 [::]:* 592/chronyd
数据库安全设置
[root@localhost /]# mysql_secure_installation
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):
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] y
new password:
re-enter new password:
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] y
... 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] n
... skipping.
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] y
- 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] y
... 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 /]# mysql -uroot -p
enter password:
welcome to the mariadb monitor. commands end with ; or \g.
your mariadb connection id is 11
server version: 5.5.52-mariadb mariadb server
copyright (c) 2000, 2016, oracle, mariadb corporation ab and others.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mariadb [(none)]> show databases;
+--------------------+
| database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.02 sec)
mariadb [(none)]>
[root@localhost /]# yum search php7
loaded plugins: fastestmirror, langpacks
loading mirror speeds from cached hostfile
epel/x86_64/metalink | 5.9 kb 00:00:00
* base: mirrors.aliyun.com
* epel: my.mirrors.thegigabit.com
* extras: mirrors.cn99.com
* updates: mirrors.163.com
* webtatic: uk.repo.webtatic.com
epel | 5.4 kb 00:00:00
webtatic | 3.6 kb 00:00:00
(1/5): epel/x86_64/group_gz | 90 kb 00:00:01
(2/5): webtatic/x86_64/group_gz | 448 b 00:00:04
(3/5): epel/x86_64/primary_db | 6.9 mb 00:00:06
(4/5): epel/x86_64/updateinfo | 1.0 mb 00:00:10
(5/5): webtatic/x86_64/primary_db | 232 kb 00:00:14
============================================================= n/s matched: php7 =============================================================
mod_php71w.x86_64 : php module for the apache http server
mod_php72w.x86_64 : php module for the apache http server
php70w.x86_64 : php scripting language for creating dynamic web sites
php70w-bcmath.x86_64 : a module for php applications for using the bcmath library
php70w-cli.x86_64 : command-line interface for php
php70w-common.x86_64 : common files for php
php70w-dba.x86_64 : a database abstraction layer module for php applications
php70w-devel.x86_64 : files needed for building php extensions
php70w-embedded.x86_64 : php library for embedding in applications
php70w-enchant.x86_64 : enchant spelling extension for php applications
php70w-fpm.x86_64 : php fastcgi process manager
php70w-gd.x86_64 : a module for php applications for using the gd graphics library
php70w-imap.x86_64 : a module for php applications that use imap
php70w-interbase.x86_64 : a module for php applications that use interbase/firebird databases
php70w-intl.x86_64 : internationalization extension for php applications
php70w-ldap.x86_64 : a module for php applications that use ldap
php70w-mbstring.x86_64 : a module for php applications which need multi-byte string handling
php70w-mcrypt.x86_64 : standard php module provides mcrypt library support
php70w-mysql.x86_64 : a module for php applications that use mysql databases
php70w-mysqlnd.x86_64 : a module for php applications that use mysql databases
php70w-odbc.x86_64 : a module for php applications that use odbc databases
php70w-opcache.x86_64 : an opcode cache zend extension
php70w-pdo.x86_64 : a database access abstraction module for php applications
php70w-pdo_dblib.x86_64 : mssql database module for php
php70w-pear.noarch : php extension and application repository framework
php70w-pecl-apcu.x86_64 : apcu - apc user cache
php70w-pecl-apcu-devel.x86_64 : apcu developer files (header)
php70w-pecl-geoip.x86_64 : extension to map ip addresses to geographic places
php70w-pecl-igbinary.x86_64 : replacement for the standard php serializer
php70w-pecl-igbinary-devel.x86_64 : igbinary developer files (header)
php70w-pecl-imagick.x86_64 : provides a wrapper to the imagemagick library
php70w-pecl-imagick-devel.x86_64 : imagick developer files (header)
php70w-pecl-memcached.x86_64 : extension to work with the memcached caching daemon
php70w-pecl-mongodb.x86_64 : pecl package mongodb driver
php70w-pecl-redis.x86_64 : extension for communicating with the redis key-value store
php70w-pecl-xdebug.x86_64 : pecl package for debugging php scripts
php70w-pgsql.x86_64 : a postgresql database module for php
php70w-phpdbg.x86_64 : interactive php debugger
php70w-process.x86_64 : modules for php script using system process interfaces
php70w-pspell.x86_64 : a module for php applications for using pspell interfaces
php70w-recode.x86_64 : a module for php applications for using the recode library
php70w-snmp.x86_64 : a module for php applications that query snmp-managed devices
php70w-soap.x86_64 : a module for php applications that use the soap protocol
php70w-tidy.x86_64 : standard php module provides tidy library support
php70w-xml.x86_64 : a module for php applications which use xml
php70w-xmlrpc.x86_64 : a module for php applications which use the xml-rpc protocol
php71w-bcmath.x86_64 : a module for php applications for using the bcmath library
php71w-cli.x86_64 : command-line interface for php
php71w-common.x86_64 : common files for php
php71w-dba.x86_64 : a database abstraction layer module for php applications
php71w-devel.x86_64 : files needed for building php extensions
php71w-embedded.x86_64 : php library for embedding in applications
php71w-enchant.x86_64 : enchant spelling extension for php applications
php71w-fpm.x86_64 : php fastcgi process manager
php71w-gd.x86_64 : a module for php applications for using the gd graphics library
php71w-imap.x86_64 : a module for php applications that use imap
php71w-interbase.x86_64 : a module for php applications that use interbase/firebird databases
php71w-intl.x86_64 : internationalization extension for php applications
php71w-ldap.x86_64 : a module for php applications that use ldap
php71w-mbstring.x86_64 : a module for php applications which need multi-byte string handling
php71w-mcrypt.x86_64 : standard php module provides mcrypt library support
php71w-mysql.x86_64 : a module for php applications that use mysql databases
php71w-mysqlnd.x86_64 : a module for php applications that use mysql databases
php71w-odbc.x86_64 : a module for php applications that use odbc databases
php71w-opcache.x86_64 : an opcode cache zend extension
php71w-pdo.x86_64 : a database access abstraction module for php applications
php71w-pdo_dblib.x86_64 : mssql database module for php
php71w-pear.noarch : php extension and application repository framework
php71w-pecl-apcu.x86_64 : apcu - apc user cache
php71w-pecl-apcu-devel.x86_64 : apcu developer files (header)
php71w-pecl-geoip.x86_64 : extension to map ip addresses to geographic places
php71w-pecl-igbinary.x86_64 : replacement for the standard php serializer
php71w-pecl-igbinary-devel.x86_64 : igbinary developer files (header)
php71w-pecl-imagick.x86_64 : provides a wrapper to the imagemagick library
php71w-pecl-imagick-devel.x86_64 : imagick developer files (header)
php71w-pecl-memcached.x86_64 : extension to work with the memcached caching daemon
php71w-pecl-mongodb.x86_64 : pecl package mongodb driver
php71w-pecl-redis.x86_64 : extension for communicating with the redis key-value store
php71w-pecl-xdebug.x86_64 : pecl package for debugging php scripts
php71w-pgsql.x86_64 : a postgresql database module for php
php71w-phpdbg.x86_64 : interactive php debugger
php71w-process.x86_64 : modules for php script using system process interfaces
php71w-pspell.x86_64 : a module for php applications for using pspell interfaces
php71w-recode.x86_64 : a module for php applications for using the recode library
php71w-snmp.x86_64 : a module for php applications that query snmp-managed devices
php71w-soap.x86_64 : a module for php applications that use the soap protocol
php71w-tidy.x86_64 : standard php module provides tidy library support
php71w-xml.x86_64 : a module for php applications which use xml
php71w-xmlrpc.x86_64 : a module for php applications which use the xml-rpc protocol
php72w-bcmath.x86_64 : a module for php applications for using the bcmath library
php72w-cli.x86_64 : command-line interface for php
php72w-common.x86_64 : common files for php
php72w-dba.x86_64 : a database abstraction layer module for php applications
php72w-devel.x86_64 : files needed for building php extensions
php72w-embedded.x86_64 : php library for embedding in applications
php72w-enchant.x86_64 : enchant spelling extension for php applications
php72w-fpm.x86_64 : php fastcgi process manager
php72w-gd.x86_64 : a module for php applications for using the gd graphics library
php72w-imap.x86_64 : a module for php applications that use imap
php72w-interbase.x86_64 : a module for php applications that use interbase/firebird databases
php72w-intl.x86_64 : internationalization extension for php applications
php72w-ldap.x86_64 : a module for php applications that use ldap
php72w-mbstring.x86_64 : a module for php applications which need multi-byte string handling
php72w-mysql.x86_64 : a module for php applications that use mysql databases
php72w-mysqlnd.x86_64 : a module for php applications that use mysql databases
php72w-odbc.x86_64 : a module for php applications that use odbc databases
php72w-opcache.x86_64 : an opcode cache zend extension
php72w-pdo.x86_64 : a database access abstraction module for php applications
php72w-pdo_dblib.x86_64 : mssql database module for php
php72w-pear.noarch : php extension and application repository framework
php72w-pecl-apcu.x86_64 : apcu - apc user cache
php72w-pecl-apcu-devel.x86_64 : apcu developer files (header)
php72w-pecl-geoip.x86_64 : extension to map ip addresses to geographic places
php72w-pecl-igbinary.x86_64 : replacement for the standard php serializer
php72w-pecl-igbinary-devel.x86_64 : igbinary developer files (header)
php72w-pecl-imagick.x86_64 : provides a wrapper to the imagemagick library
php72w-pecl-imagick-devel.x86_64 : imagick developer files (header)
php72w-pecl-libsodium.x86_64 : wrapper for the sodium cryptographic library
php72w-pecl-memcached.x86_64 : extension to work with the memcached caching daemon
php72w-pecl-mongodb.x86_64 : pecl package mongodb driver
php72w-pecl-redis.x86_64 : extension for communicating with the redis key-value store
php72w-pecl-xdebug.x86_64 : pecl package for debugging php scripts
php72w-pgsql.x86_64 : a postgresql database module for php
php72w-phpdbg.x86_64 : interactive php debugger
php72w-process.x86_64 : modules for php script using system process interfaces
php72w-pspell.x86_64 : a module for php applications for using pspell interfaces
php72w-recode.x86_64 : a module for php applications for using the recode library
php72w-snmp.x86_64 : a module for php applications that query snmp-managed devices
php72w-soap.x86_64 : a module for php applications that use the soap protocol
php72w-sodium.x86_64 : wrapper for the sodium cryptographic library
php72w-tidy.x86_64 : standard php module provides tidy library support
php72w-xml.x86_64 : a module for php applications which use xml
php72w-xmlrpc.x86_64 : a module for php applications which use the xml-rpc protocol
name and summary matches only, use "search all" for everything.