| 风's profile风来西林PhotosBlogLists | Help |
|
|
November 05 忘记了UBUNTU系统中的MYSQL ROOT 密码修改方法(1)以系统root权限登陆 (2)停止MYSQL服务器: mysqladmin shutdown (3)跳过授权表执行MYSQL服务器: mysqld_safe --skip-grant-tables --skip-networking &
(注:参数--skip-grant-tables为跳过授权表;--skip-networking为不监听TCP/IP连接) October 28 ubuntu 下将通过APT安装将mod模式的PHP改成fastcgi在Ubuntu中搭建一般的LAMP环境实在是太简单的一件事, 只需要: $sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 然而, 这样搭建出来的LAMP环境, PHP是通过Apache2的mod执行的, 这也就是软件包libapache2-mod-php5的作用. 通过mod执行的PHP有速度快, 方便等诸多优势.但是在其他方面诸如用户权限分离和使用动态虚拟主机创建等,都需要使用fastcgi模式来运行PHP。 在网上找到了一篇资料测试通过,拿出来给大家分享!具体操作入下: 首先, 删除libapache2-mod-php5, 因为没用了.$sudo a2dismod php5 $sudo apt-get remove libapache2-mod-php5 安装cgi版的php(自己会支持fcgi的)和apache2的action模块 $sudo apt-get install php5-cgi 新建目录, 把安装的php5-cgi扔过去 $sudo mkdir /usr/local/php5-fcgi 下面关键了, 总是出错的就是这了 ScriptAlias /fcgi-bin/ "/usr/local/php5-fcgi/bin/" 然后重启apache2, 完事. October 27 修改新数据在安装时没设置密码而无法登陆的办法今天拿到一台安装有UBUNTU系统的服务器,MYSQL都是APT安装的,哎,老大安装机器的时候不知道怎么了,都不喜欢在MYSQL里设置密码,我哭~!然后尝试登陆,怎么也登陆不上去,各种修改MYSQL root密码的方法都用都不成,后来急得我把user表的数据库文件用编辑器打开来看。发现里面只有一个debian-sys-maint用户。当时差点没哭出来。难怪我使用安全模式登陆到 MYSQL没有发现其他的用户。 着下可有办法了。我先把一个正常能登陆(有没有设置密码都无所谓)的MYSQL的USER表文件CP到着个机器的数据库表文件目录里,然后修改文件权限,重启服务。此时提供会报错误~! error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)' 不怕。数据还是能起来的。呵呵。正常登陆进去后就开始修改一下user表中的debian-sys-maint用户密码,传说因为是系统启动MYSQL的时候专用帐号,每次关闭和启动的时候密码都是新的,所以就会出现前面那个系统错误。修改了它就OK了。当前最新的密码应该在你系统的 vi /etc/mysql/debian.cnf # Automatically generated for Debian scripts. DO NOT TOUCH! 执行如下MYSQL命令: SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('你的密码'); 然后再重启MYSQL就发现错误没辣~~!搞定。 后话:发现咱老大也瞒懒的~~!怒~~! October 23 指令名称 : chmod使用权限 : 所有使用者
October 14 ubuntu 中proftpd+mysql+虚拟用户+匿名用户+磁盘限额的配置安装mysql和phpmyadmin,其中phpmyadmin不是必需的 # apt-get install mysql-server mysql-client libmysqlclient15-dev phpmyadmin apache2 为mysql设置root密码 # mysqladmin -u root password yourrootsqlpassword 如果需要其他人访问本机的mysql,同样需要设置密码 # mysqladmin -h server1.example.com -u root password yourrootsqlpassword 安装带mysql支持的proftpd,注意选择proftpd工作在standalone模式 # apt-get install proftpd-mysql 建立虚拟用户组,这个是为了把proftpd用户虚拟到本机的一个用户上。注意下面的2001修改为自定义的。 # groupadd -g 2001 ftpgroup 建立proftpd使用的mysql数据库ftp,并创建数据表。 mysql> create database ftp; 为proftpd访问数据创建的帐号 mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO 'proftpd'@'localhost' IDENTIFIED BY 'password'; 创建ftpgroup表 CREATE TABLE ftpgroup( CREATE TABLE ftpquotalimits (
CREATE TABLE ftpquotatallies ( name varchar(30) NOT NULL default '', quota_type enum('user','group','class','all') NOT NULL default 'user', bytes_in_used int(10) unsigned NOT NULL default '0', bytes_out_used int(10) unsigned NOT NULL default '0', bytes_xfer_used int(10) unsigned NOT NULL default '0', files_in_used int(10) unsigned NOT NULL default '0', files_out_used int(10) unsigned NOT NULL default '0', files_xfer_used int(10) unsigned NOT NULL default '0' ) TYPE=MyISAM; CREATE TABLE ftpuser (
修改/etc/proftpd/proftpd.conf 在<IfModule mod_sql.c>中增加以下代码: # The passwords in MySQL are encrypted using CRYPT # used to connect to the database # Here we tell ProFTPd the names of the database columns in the "usertable" # Here we tell ProFTPd the names of the database columns in the "grouptable" # set min UID and GID - otherwise these are 999 each # create a user's home directory on demand if it doesn't exist # Update count every time user logs in # Update modified everytime user uploads or deletes a file
在<IfModule mod_quotatab.c>中增加一下代码: # User quotas SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies QuotaLimitTable sql:/get-quota-limit RootLogin off 分别增加日志 QuotaLog "/var/log/proftpd.quota.log" SQLLogFile /var/log/proftpd.sql.log 录入测试用户数据 INSERT INTO `ftpgroup` (`groupname`, `gid`, `members`) VALUES ('ftpgroup', 2003, 'ftpuser'); INSERT INTO `ftpquotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('test', 'user', 'true', 'hard', 15728640, 0, 0, 0, 0, 0); INSERT INTO `ftpuser` (`id`, `userid`, `passwd`, `uid`, `gid`, `homedir`, `shell`, `count`, `accessed`, `modified`) VALUES(1, 'test', 'test123', 2001, 2001, '/home/www.example.com', '/sbin/nologin', 0, '', ''); 注意:如果的你的proftpd版本大于1.3.0的话 SQLHomedirOnDemand 需要改用 CreateHome来代替! name: - 用户帐号 debian 软件的安装与卸载一基本配置 1. /etc/apt/sources.list文件的基本格式: deb http://site.http.org/debian distribution section1 section2 section3 section3 deb 二进制程序包 deb-src 原代码程序包 deb http://http.us.debian.org/debian stable main contrib non-free deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free apt 会忽略以"#"开头的行 注意: 修改/etc/apt/sources.list后,应及时更新数据库列表 2.制作本地apt # mkdir /root/debs 3.寻找速度最快的下载镜相:netselect, netselect-apt 安装netselect软件包 us.debian.org people.debian.org gluck.debian.org http://www.debian.org/mirror/mirrors_full 4.把CD-ROM加入到你的/etc/apt/sources.list文件 如果使用apt自动从CD-ROM上安装软件或升级系统,可以把它加 入/etc/apt/sources.list文件 注: CD-ROM必须在/etc/fstab文件中已正确配置 二、管理包 1.apt系统使用一个数据库列表来记录系统已经安装了哪些软件,哪些没有安装,哪 些软件可以通过apt系统自动安装 apt-get通过分析这个数据库来决定如何安装软件 , 2.安装软件包 软件包会被下载到/var/cache/apt/archives 稍后进行安装 reinstall参数,如 package=version来指定软件的安装版本,如 3.移除软件包 仅仅移除此软件,而保留对它有依赖性的软件包。 4.升级软件包 5.升级到一个新的版本 6.移除无用的软件包 。这样这个目录所占空间会越来越大,幸运的是apt提供了相应的管理工具 /var/cache/apt/archives/partial/目录下所有包(锁定的除外)。 7. 是有些人想运行某个软件的最新版,却又不愿把这个系统升级为unstable,即想使用 一个混合的系统,那么可以这样做: 9.从一个特定的debian版本升级软 10.如何在软件升级时避免特定软件不会被升级 例如我要保持gaim的0.58版本 只需加上: 被安装 级为999 获取软件信息 1.搜寻软件名 2.用dpkg查询软件名 3.询问式安装 4.查询文件的归属 程序源文件 1.下载程序源码 2.编译软件 October 13 DEBIAN的CN99源顶!我常用的。打开 /etc/apt/sources.list
deb http://ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu-cn/ hardy main restricted universe multiverse 然后在
# apt-get update && apt-get upgrade
ubuntu安装和配置SVN1. 安装SVN 在checkout的情况下出现类似提示: svn: Can't convert string from 'UTF-8' to native encoding 解决的办法是在root权限下在任何目录下执行LANG="zh_CN.UTF-8"这真是一个不是问题的问题,可能是为了方便将语言格式改成E文造成的 September 07 【adduser】新增使用者 part1在Slackware中,adduser
指令是個script程式,利用交談的方式取得輸入的用戶帳號資料,然後再交由真正建立帳號的useradd指令建立新用戶,如此可方便管理員建立用戶帳
號。在Red Hat Linux中,adduser指令則是useradd指令的符號連接,兩者實際上是同一個指令。 【adduser】 adduser 除了新增帳號外,還會自動新增 /home/XXX(家目錄) 並將 /etc/skel 複製預設的檔案至使用者家目錄。Enter 後得輸入密碼及相關資訊..等等,其中這些資訊當放在 /etc/passwd 裡。 # sudo adduser albert要是想讓新增的使用者具有管理權限,則輸入 # adduser XXX admin可使用 grep 做確認。想刪除可用 deluser。 November 29 Linux配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD库redhat linux9.0下配置APACHE2.0.55 +PHP5.1.1+MYSQL5.0.16+GD库 首先,服务器GCC要有,不然什么都不能做.可以用gcc -v来查看是否安装了GCC, #gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34) 有以上类似信息说明已有GCC, 如果你没有,请先拿安装光盘装好它 请下载以下所有的东西: httpd-2.0.55.tar.gz MySQL-client-5.0.16-0.i386.rpm MySQL-server-5.0.16-0.i386.rpm MySQL-devel-5.0.16-0.i386.rpm php-5.1.1.tar.gz ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz gd-2.0.28.tar.gz libxml2-2.6.11.tar.gz zlib-1.2.1.tar.gz jpegsrc.v6b.tar.gz libpng-1.2.5.tar.gz xpm-3.4k-2.i386.rpm gd-devel-1.8.4-11.i386.rpm 可能你的电脑不需要这么多.但最好都下载吧. 不过,可能你看到这贴子的时候会有以上软件新的版本下载了.看着办吧. 开始装吧>>>>>>>>>>>>>>>>>>>>>>>>> 先安装MYSQL 服务器 #rpm -ivh MySQL-server-5.0.16-0.i386.rpm 接着客户端 #rpm -ivh MySQL-client-5.0.16-0.i386.rpm 安装mysql-devel #rpm -ivh MySQL-devel-5.0.16-0.i386.rpm(没有它不能安装php5.1.1) 安装好后试试能不能用 #mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 27651 to server version: 4.0.20-standard Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 说明OK 请自己改mysql的密码 安装GD库基本包 #rpm -ivh gd-devel-1.8.4-11.i386.rpm 安装XPM支持 #rpm -ivh xpm-3.4k-2.i386.rpm 安装libxml2 (记得PHP5.1.1只支持libxml2-2.6.11以上版本) #tar zxvf libxml2-2.6.11.tar.gz #cd libxml2-2.6.11 #./configure #make #make install 开始装GD库支持 ------------------------------------------------------- ZLIB #tar zxvf zlib-1.2.1.tar.gz #cd zlib-1.2.1 #./configure #make #make install JPEGSRC #tar zxvf jpegsrc.v6b.tar.gz #cd jpegsrc-6b #./configure #make #make install-lib #make install LIBPNG #tar zxvf libpng-1.2.5.tar.gz #cd libpng-1.2.5 #cp scripts/makefile.std Makefile #make #make install 最后是GD2.* gd-2.0.28 #tar zxvf gd-2.0.28.tar.gz #cd gd-2.0.28 #./configure --with-png=/usr/local --with-jpeg=/usr/local --with-freetype=/usr #make #make install ---------------------------------------------- 上面一切都很顺利的话,GD就算成功的安装上了. 如果有问题,应该是缺少支持包,总之是少什么就下载什么来安装上. 跟着下来,开始安装APAHCHE2和PHP5 #tar zxvf httpd-2.0.55.tar.gz #cd httpd-2.0.55 #./configure --prefix=/usr/local/apache2 --enable-module=so #make #make install #tar zxvf php-5.1.1.tar.gz #cd php-5.1.1 #./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local --enable-trace-vars --with-zlib-dir=/usr/local -with-mysql=/var/lib/mysql #make #make install !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 我是把他们分别安装在/usr/local/apache2 & PHP目录下的 所有的安装工作做好了,接着我们来配置. 复制PHP.INI文件到正确位置 在PHP目录下运行 #cp php.ini-dist /usr/local/php/lib/php.ini 编辑apache配置文件httpd.conf #vi /usr/local/apache2/conf/httpd.conf 要改的有如下几处: 一般都在 #AddType application/x-tar .tgz 下加一行 AddType application/x-httpd-php .php 还有找到 DirectoryIndex index.html index.html.var 在后面加 index.php 让它把index.php做为默认页 再找 #ServerName 把#去掉,后面的IP改成你的IP. 找到 DocumentRoot "/usr/local/apache2/htdocs" 把/usr/local/apache2/htdocs改为你存放网页文件的路径 比如我是放在/myweb目录下,所以我以后上传PHP文件就放在/myweb目录下,然后用IP访问,就能看到首页了 差不多就这些了,至于apache2其它优化,请看www.phpv.net 里的apache配置那一分类. 保存httpd.conf文件. 启动它 # /usr/local/apache2/bin/apachectl start 如果没有出错,写一个测试页放到你网页目录下, 我的就是上面所说的 /myweb #vi /home/easy/index.php phpinfo(); 保存.试试在测试器里打IP进去就可以看到PHPINFO页了 好了.如无意外.你现在可以放心在你的机器上运行PHP脚本连接mysql了. 用ZendOptimizer-2.5.3加速PHP #tar zxvf ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz #cd ZendOptimizer-2.5.3-linux-glibc21-i386 #./install.sh 一路默认下去应该就好了. 再看看测试页, 找找是不是这样的? This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies |
|
|