Rootop 服务器运维与web架构

2010-12-02
发表者 Venus
暂无评论

mysql 修改密码、开启远程登录(远程访问)

今天朋友做服务器,遇到了点儿问题,协助给解决了一下,其实也没什么,mysql安装及配置问题。

系统为CentOS,内核 2.6.18-164.el5

安装mysql时提示gcc编译错误,估计是没安装gcc编译器。

yum install -y gcc

yum install -y mysql

然后把相关的rpm包都装上,在此不做写出

登陆mysql:

默认用户名为root,密码为空

[root@fast ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

修改密码为123:

mysql> set password=password(‘123’);
Query OK, 0 rows affected (0.00 sec)

需要远程登录mysql数据库,默认是关闭的,要启动它:

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’IDENTIFIED BY ‘YOURPASSWORD’ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

刷新生效

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

完成。

2010-12-02
发表者 Venus
暂无评论

Neither host ‘localhost’ nor ‘localhost’ could be looked up

安装MYSQL数据库时,启动服务遇到问题,提示如下,由提示错误可以看出,是因为主机名的解析有问题

查看/etc/hosts,文件中没有任何内容,添加一行配置,内容如下:

127.0.0.1        localhost

保存退出,重启服务测试

之前的错误提示:

[root@localhost yum.repos.d]# service mysqld start
初始化 MySQL 数据库: Neither host ‘localhost’ nor ‘localhost’ could be looked up with
/usr/bin/resolveip
Please configure the ‘hostname’ command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the –force option
                                                           [失败]

[root@localhost yum.repos.d]# vi /etc/hosts
[root@localhost yum.repos.d]# service mysqld start
初始化 MySQL 数据库: Installing MySQL system tables…
100329 18:18:19 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to

4294967295
100329 18:18:19 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to

4294967295
OK
Filling help tables…
100329 18:18:19 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to

4294967295
100329 18:18:19 [Warning] option ‘max_join_size’: unsigned value 18446744073709551615 adjusted to

4294967295
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com
                                                           [确定]
启动 MySQL:                                               [确定]
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show databases
    -> ;
+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| test               |
+——————–+
3 rows in set (0.00 sec)

mysql> exit
Bye
[root@localhost yum.repos.d]# mysqladmin -u root password root      //修改密码为root

[root@localhost yum.repos.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

2010-12-02
发表者 Venus
暂无评论

破解 系统登录密码-administrator账号密码

1:删除系统安装目录\system32\config下的SAM文件,然后复制c:\windows\repair 下的这五个文件software,system,security,default和sam

3:你有双系统只需要把 c:\windows\repair 下的software, system, security, default , sam 五个文件copy到 c:\windows\system32\config\ 下,覆盖原来的文件即可

  只有一个os..若 C 盘是 FAT32 的话可在 DOS 下执行,如果是 NTFS 的话,用能识别出 NTFS 分区的工具来实现。执行下面的操作:

delete c:\windows\system32\config\system

delete c:\windows\system32\config\software

delete c:\windows\system32\config\sam

delete c:\windows\system32\config\security

delete c:\windows\system32\config\default

copy c:\windows\repair\system c:\windows\system32\config\system

copy c:\windows\repair\software c:\windows\system32\config\software

copy c:\windows\repair\sam c:\windows\system32\config\sam

copy c:\windows\repair\security c:\windows\system32\config\security

copy c:\windows\repair\default c:\windows\system32\config\default

(我在网上找了一下用NTFS Reader for DOS 1.02这个软件也可以

同样支持在DOS下支持FAT文件系统)

下载地址:http://www.onlinedown.net/soft/10162.htm#download

2010-12-02
发表者 Venus
暂无评论

apache 虚拟目录错误:CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional “env=” clause (see docs)

[root@rhvl venus]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: Syntax error on line 1000 of /etc/httpd/conf/httpd.conf:
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional “env=” clause (see docs)
                                                           [FAILED]重启服务时出现以上错误。查了点儿资料,没感觉有什么有效信息,就再次查看配置文件。
觉得日志文件格式(common)有点儿问题,追加到后面后,再次重启服务,OK了。

<VirtualHost www.venus.com >
    ServerAdmin venuslinux@gmail.com
    DocumentRoot /var/www/html/upload/
    ServerName www.venus.com
    ErrorLog logs/venus/venussite.log
    CustomLog logs/venus/venuscus.log common //把common追加到后面 common是日志定义的格式
</VirtualHost>

2010-12-02
发表者 Venus
暂无评论

RedHat5.4 安装PIDGIN

在redhat5.4环境下安装PIDGIN过程。

到官方下载repo文件复制到/etc/yum.repo.d/下,即为yum安装(http://www.pidgin.im/download/centos_rhel/
[root@redhatcui Server]# yum install pidgin
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package pidgin.i386 0:2.6.6-0.el5 set to be updated
–> Processing Dependency: libpurple = 2.6.6 for package: pidgin
–> Processing Dependency: libgtkspell.so.0 for package: pidgin
–> Processing Dependency: libpurple.so.0 for package: pidgin
–> Processing Dependency: perl(Purple) for package: pidgin
–> Running transaction check
—> Package gtkspell.i386 0:2.0.11-2.1 set to be updated
—> Package libpurple.i386 0:2.6.6-0.el5 set to be updated
–> Processing Dependency: libsilc-1.0.so.2 for package: libpurple
–> Processing Dependency: cyrus-sasl-md5 for package: libpurple
–> Processing Dependency: libsilcclient-1.0.so.1 for package: libpurple
–> Running transaction check
—> Package cyrus-sasl-md5.i386 0:2.1.22-5.el5 set to be updated
—> Package libpurple.i386 0:2.6.6-0.el5 set to be updated
–> Processing Dependency: libsilc-1.0.so.2 for package: libpurple
–> Processing Dependency: libsilcclient-1.0.so.1 for package: libpurple
–> Finished Dependency Resolution
libpurple-2.6.6-0.el5.i386 from pidgin has depsolving problems
  –> Missing Dependency: libsilc-1.0.so.2 is needed by package libpurple-2.6.6-0.el5.i386 (pidgin)
libpurple-2.6.6-0.el5.i386 from pidgin has depsolving problems
  –> Missing Dependency: libsilcclient-1.0.so.1 is needed by package libpurple-2.6.6-0.el5.i386 (pidgin)
Error: Missing Dependency: libsilc-1.0.so.2 is needed by package libpurple-2.6.6-0.el5.i386 (pidgin)
Error: Missing Dependency: libsilcclient-1.0.so.1 is needed by package libpurple-2.6.6-0.el5.i386 (pidgin)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
                        package-cleanup –dupes
                        rpm -Va –nofiles –nodigest
The program package-cleanup is found in the yum-utils package.
出现两个error,根据错误信息到google上search。或者是根据libsilc-1.0.so.2到rpm.pbone.net下载相应rpm包。
搜索后,确定缺少的是libsilc-1.0.2-6.fc8.i386这个文件,rpm.pbone.net上面没有redhat所需的相关包,但是我们可以下载fedora的包进行安装。

[root@redhatcui ~]# wget -c ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/updates/8/i386.newkey/libsilc-1.0.2-6.fc8.i386.rpm
–2010-03-11 15:17:48–  ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/updates/8/i386.newkey/libsilc-1.0.2-6.fc8.i386.rpm
           => `libsilc-1.0.2-6.fc8.i386.rpm’
Resolving ftp.pbone.net… 85.14.85.4
Connecting to ftp.pbone.net|85.14.85.4|:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done.    ==> PWD … done.
==> TYPE I … done.  ==> CWD /mirror/archive.fedoraproject.org/fedora/linux/updates/8/i386.newkey … done.
==> SIZE libsilc-1.0.2-6.fc8.i386.rpm … 422169
==> PASV … done.    ==> RETR libsilc-1.0.2-6.fc8.i386.rpm … done.
Length: 422169 (412K)

100%[===================================================================================================================>] 422,169      130K/s   in 3.2s   

2010-03-11 15:18:02 (130 KB/s) – `libsilc-1.0.2-6.fc8.i386.rpm’ saved [422169]

[root@redhatcui ~]# ll
total 1348
-rw——- 1 root root   1050 Mar 11 09:31 anaconda-ks.cfg
drwxr-xr-x 2 root root   4096 Mar 11 14:38 Desktop
-rw-r–r– 1 root root  22605 Mar 11 10:10 eioXpacklog.txt
-rw-r–r– 1 root root  27265 Mar 11 09:31 install.log
-rw-r–r– 1 root root   3671 Mar 11 09:30 install.log.syslog
-rw-r–r– 1 root root 422169 Mar 11 15:18 libsilc-1.0.2-6.fc8.i386.rpm
drwxr-xr-x 2 root root   4096 Mar 11 09:58 pic
-rw-r–r– 1 root root 833777 Feb 10 21:26 rarlinux-3.9.2.tar.gz
-rw-r–r– 1 root root    240 Mar 11 09:42 scsrun.log
[root@redhatcui ~]# rpm -ivh libsilc-1.0.2-6.fc8.i386.rpm
warning: libsilc-1.0.2-6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6df2196f
Preparing…                ########################################### [100%]
   1:libsilc                ########################################### [100%]
[root@redhatcui ~]# yum install -y pidgin
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package pidgin.i386 0:2.6.6-0.el5 set to be updated
–> Processing Dependency: libpurple = 2.6.6 for package: pidgin
–> Processing Dependency: libgtkspell.so.0 for package: pidgin
–> Processing Dependency: libpurple.so.0 for package: pidgin
–> Processing Dependency: perl(Purple) for package: pidgin
–> Running transaction check
—> Package gtkspell.i386 0:2.0.11-2.1 set to be updated
—> Package libpurple.i386 0:2.6.6-0.el5 set to be updated
–> Processing Dependency: cyrus-sasl-md5 for package: libpurple
–> Running transaction check
—> Package cyrus-sasl-md5.i386 0:2.1.22-5.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
Package                                  Arch                           Version                                  Repository                            Size
=============================================================================================================================================================
Installing:
pidgin                                   i386                           2.6.6-0.el5                              pidgin                               1.5 M
Installing for dependencies:
cyrus-sasl-md5                           i386                           2.1.22-5.el5                             rpminstall                            45 k
gtkspell                                 i386                           2.0.11-2.1                               rpminstall                            30 k
libpurple                                i386                           2.6.6-0.el5                              pidgin                               8.5 M

Transaction Summary
=============================================================================================================================================================
Install      4 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 10 M
Downloading Packages:
(1/4): pidgin-2.6.6-0.el5.i386.rpm                                                                                                    | 1.5 MB     00:16     
(2/4): libpurple-2.6.6-0.el5.i386.rpm                                                                                                 | 8.5 MB     02:10     
————————————————————————————————————————————————————-
Total                                                                                                                         66 kB/s |  10 MB     02:36     
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID a9464aa9
pidgin/gpgkey                                                                                                                         | 1.3 kB     00:00     
Importing GPG key 0xA9464AA9 “Stu Tomlinson <stu@nosnilmot.com>” from http://rpm.pidgin.im/RPM-GPG-KEY-pidgin
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : cyrus-sasl-md5                                                                                                                        1/4
  Installing     : libpurple                                                                                                                             2/4
  Installing     : gtkspell                                                                                                                              3/4
  Installing     : pidgin                                                                                                                                4/4

Installed:
  pidgin.i386 0:2.6.6-0.el5                                                                                                                                 

Dependency Installed:
  cyrus-sasl-md5.i386 0:2.1.22-5.el5                      gtkspell.i386 0:2.0.11-2.1                      libpurple.i386 0:2.6.6-0.el5                     

Complete!
[root@redhatcui ~]#

OK,安装完毕。

安装过程可能遇到更多的问题,RedHat下,包的依赖关系的确太繁琐,只能慢慢来。
Click ‘applications’-click’internet’-click ‘pingin internet messenger’, run successfully.