Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Build LAMP by Centos7.2

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Close firewall: (for specific documents, please contact this blogger. There is a blogger's email address on the home page)

2. Install iptables firewall

Vi / etc/sysconfig/iptables # Editing Firewall profile

3. Restart the service

4. Close SELINUX

5. Temporarily turn off the firewall

6. Install Apache

7. Restart the service

8. Open the server IP address in the client browser for testing

Second, install MariaDB

In CentOS 7.0, MariaDB has been used instead of MySQL database

1. Install MariaDB

two。 Restart the service

3. Copy

4. Set permissions for root users

Enter and enter Y according to the prompt

Enter the password twice and enter

Enter Y all the way according to the prompt

Last appeared: Thanks for using MariaDB!

After setting the MariaDB password, restart MariaDB:

Some common operations of the database:

Delete databases and data tables

Mysql > drop database database name

Mysql > drop table datasheet name

Delete account and permissions:

> drop user user name @'%'

> drop user user name @ localhost

(the above Disallow root login remotely? [YOrganization], enter n to allow remote login to the root password.

If the database is still not accessible remotely, execute:

GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' yunjisuan'

Flush privileges;)

Third, install PHP

Install the PHP5.4 version

2. Install PHP components to make PHP support MariaDB

# choose the above installation package to install here, and enter Y enter according to the prompt

Restart the service

Install the PHP5.6.30 version

Execute the following command to upgrade the software repository

Execute the following command to delete php

Then ask you if you want to continue as installed, and type yes to php

Install php version 5.6 (php56w-devel this is not required)

Restart httpd

View the latest version

Php-v

It should be 5.6 now!

Php website is not working properly. It is found that it is missing.

Apache configuration! There can be no configuration here! Can be ignored

Vi / etc/httpd/conf/httpd.conf # edit file

ServerTokens = ProductOnly

ServerSignature On # added to display the version of Apache in the error page, Off does not show

Options Indexes FollowSymLinks # modified to: Options Includes ExecCGI FollowSymLinks (allows the server to execute CGI and SSI, and forbids listing of directories)

# AddHandler cgi-script .cgi # modified to: AddHandler cgi-script .cgi .pl (allows CGI scripts with .pl extension to run)

Change AllowOverride None # to: AllowOverride All (allow .htaccess)

Change AddDefaultCharset UTF-8 # to: AddDefaultCharset GB2312 (add GB2312 as default encoding)

# Options Indexes FollowSymLinks # modified to Options FollowSymLinks (do not display tree directory structure on browsers)

DirectoryIndex index.html # modified to: DirectoryIndex index.html index.htm Default.html Default.htmindex.php (set default home page file, add index.php)

MaxKeepAliveRequests 500 # add MaxKeepAliveRequests 500 (increase the number of simultaneous connections)

: wq! # Save exit

Restart the service

Delete the default test page

PHP configuration! You just need to change the time zone here!

Vi / etc/php.ini # editing

Date.timezone = PRC # remove the semicolon and change it to date.timezone = PRC

Disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin Posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

# list the functions that can be disabled by PHP. If some programs need to use this function, you can delete it and undisable it.

Expose_php = Off # suppresses the display of php version information

Short_open_tag = ON # supports php short tags

Open_basedir =.: / tmp/ # setting allows access to the current directory (that is, the directory where the PHP script files are located) and the / tmp/ directory, which prevents php*** from crossing sites. If there is a problem with the installer after the change (for example, the dream content management system), you can log out of this line or write directly to the program's directory / data/www.osyunwei.com/:/tmp/

: wq! # Save exit

Final configuration

Test piece

Cd / var/www/html

Vi index.php # enter the following

: wq! # Save exit

Enter the server IP address in the client browser

Note:

The default program directory for apache is / var/www/html

Permission setting: chown apache.apache-R / var/www/html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report