gentoo system configuration and installation of LNMP environment

Install Nginx * One command to get it done: USE=fastcgi emerge nginx * Create new users and groups: groupadd www useradd www -g www After Nginx is installed, the nginx group and nginx user will be added by default, but I am still used to creating a www group and www user for HTTP service users. If the HTTP server is changed to apache or lighttpd in the future, the user name and user group can remain unchanged. Install MySQL Before installing PHP, you must install MySQL first, because the MySQL operation functions in PHP need the support of MySQL header files and libraries. emerge dev-db/mysql * Initialize the database: I’m not used to installing the database in the default path /var/lib/mysql, I put it in /work/db/3306/data. mkdir -p /work/db/3306/data mysql_install_db –basedir=/usr –datadir=/work/db/3306/data –user=mysql * Modify the configuration file: vim /etc/mysql/my.cnf Change datadir to: datadir = /work/db/3306/data * Start MySQL: /etc/init.d/mysql start * Modify root password: mysqladmin -uroot password hily * Test database: mysql -uroot -p Show: gentoo setup # mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 2 Server version: 5.0.84-log Gentoo Linux mysql-5.0.84-r1 Type ‘help;’…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索