最近关注LNMP的搭建服务器技术,并自己独立组建网站服务器,我将遇到的问题列出来以便日后参考,往后我会随时更新博客。

/data0/mysql/3306/mysql: line 28: unexpected EOF while looking for matching `)'

/data0/mysql/3306/mysql: line 42: syntax error: unexpected end of file

[root@localhost 3306]# error: Found option without preceding group in config file: /data0/mysql/3306/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
WARNING: Defaults file '/data0/mysql/3306/my.cnf' not found!
error: Found option without preceding group in config file: /data0/mysql/3306/my.cnf at line: 1
Fatal error in defaults handling. Program aborted
WARNING: Defaults file '/data0/mysql/3306/my.cnf' not found!
touch: cannot touch `/usr/local/webserver/mysql/var/localhost.localdomain.err': No such file or directory
chown: cannot access `/usr/local/webserver/mysql/var/localhost.localdomain.err': No such file or directory
/usr/local/webserver/mysql/bin/mysqld_safe: line 107: /usr/local/webserver/mysql/var/localhost.localdomain.err: No such file or directory
/usr/local/webserver/mysql/bin/mysqld_safe: line 144: /usr/local/webserver/mysql/var/localhost.localdomain.err: No such file or directory
/usr/local/webserver/mysql/bin/mysqld_safe: line 107: /usr/local/webserver/mysql/var/localhost.localdomain.err: No such file or directory

connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists

解决方法: ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

[root@localhost etc]# /usr/local/webserver/php/sbin/php-fpm start

Starting php_fpm PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/pdo.mysql.so' - /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/pdo.mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
eAccelerator: Could not allocate 67108864 bytes, the maximum size the kernel allows is 33554432 bytes. Lower the amount of memory request or increase the limit in /proc/sys/kernel/shmmax.
PHP Warning: [eAccelerator] Can not create shared memory area in Unknown on line 0
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0
failed

[root@localhost /]# /usr/local/webserver/php/sbin/php-fpm start

Starting php_fpm eAccelerator: Could not allocate 67108864 bytes, the maximum size the kernel allows is 33554432 bytes. Lower the amount of memory request or increase the limit in /proc/sys/kernel/shmmax.
PHP Warning: [eAccelerator] Can not create shared memory area in Unknown on line 0
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0
failed

解决方法:echo 128000000 > /proc/sys/kernel/shmmax

[root@localhost sbin]# /usr/local/webserver/nginx/sbin/nginx

[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

[root@localhost ~]# /usr/local/webserver/nginx/sbin/nginx

[warn]: conflicting server name "192.168.208.131" on 0.0.0.0:80, ignored

[root@localhost ~]# service nginx start

nginx: unrecognized service

502 bad gateway!

no input file specified

403 Forbidden