linux编译软件

linxux下编译软件的3个通用步骤===

0:获取源码包,解压

1:配置,比如装在哪,比如读取帮助

configure

1.1:用gcc编译的软件都会有一个configure文件

1.2:configure有2个最通用选项,

         configure --prefix=/path ,指定文件的安装路径

         configure -h ,查看所有的配置选项,


将会根据你输入的参数,生成一个makefie文件(配置单),

        注意:在你configure后,源码目录下的文件已经发生了改变

因此,如果你本次configure,某个配置错了,删掉源码目录,重新解压,

或者 执行 make clean,都能够消除configure 的影响。

1.3:make 编译,这一步耗时最长

1.4:make install ,安装(就是把编译出的二进制复制到适当的目录去)


==============================如何解压======================================

.gz,   tar -zxvf /path/xx.gz

.bz,   tar -jxvf /path/xx.bz

 1、*.tar 用 tar –xvf 解压 
 2、*.gz 用 gzip -d或者gunzip 解压 
 3、*.tar.gz和*.tgz 用 tar –xzf 解压 
 4、*.bz2 用 bzip2 -d或者用bunzip2 解压 
 5、*.tar.bz2用tar –xjf 解压 
 6、*.Z 用 uncompress 解压 
 7、*.tar.Z 用tar –xZf 解压 
 8、*.rar 用 unrar e解压 
 9、*.zip 用 unzip 解压
 

解包:tar zxvf FileName.tar

  打包:tar czvf FileName.tar DirName

zip -r myfile.zip ./*
将当前目录下的所有文件和文件夹全部压缩成myfile.zip文件,-r表示递归压缩子目录下所有文件.

 
关于unzip的命令详解我写在下面:
语法:unzip [选项] 压缩文件名.zip 
各选项的含义分别为: 
-x 文件列表 解压缩文件,但不包括指定的file文件。 
-v 查看压缩文件目录,但不解压。 
-t 测试文件有无损坏,但不解压。 
-d 目录 把压缩文件解到指定目录下。 
-z 只显示压缩文件的注解。 
-n 不覆盖已经存在的文件。 
-o 覆盖已存在的文件且不要求用户确认。 
-j 不重建文档的目录结构,把所有文件解压到同一目录下。 
例1:将压缩文件text.zip在当前目录下解压缩。 
$ unzip text.zip 
例2:将压缩文件text.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令不覆盖原先的文件。 
$ unzip -n text.zip -d /tmp 
例3:查看压缩文件目录,但不解压。 
$ unzip -v text.zip 



cd httpd-2.2.9

./configure -h|less


===========http-2.2.9.tar.gz==========

tar -zxvf http-2.2.9.tar.gz

cd http-2.2.9

./configure --prefix=/usr/local/http2 \

--enable-rewirte \

--enable-modules=most


编译

make

安装

make install

启动apache

/usr/local/http2/bin


bin/apachect1 start

cd htdocs/



====================系统管理命令======================

ps -A 查看系统进程

ps -A|grep mysql  查看mysql进程有没有启动


配置mysql

增加一个用户组

groupadd mysql

useradd mysql -g mysql


cd /home/lin/tar/mysql-5.1.30

./configure --prefix=/usr/local/mysql/ \

--with-charset=utf8 \

--with-extra-charsets=gbk,gb2312,binary

make && make install


cd /home/lin/tar/mysql-5.1.30

cp support-files/my-medium.cnf /etc/my.cnf 复制一个默认的初始化数据库

vi /etc/my.cnf 对默认数据库进行编辑

set nu 显示行数

#skip-federated 在前面加个#符号


cd /usr/local/mysql/

bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/var

chown root . -R 把当前级联的都转给root用户

chown -R mysql var 单把var权限赋给mysql


bin/mysqld_safe --user=mysql & 以mysql用户的身份悄悄运行

bin/mysql -uroot -p


show databases;

use mysql

desc user;

select Host,User,Password from user;


update user set Password=password('111111')  where Host='localhost' and User='root';

flush privileges;


tar zxvf libxml2-2.6.19.tar.gz

cd libxml2-2.6.19.tar.gz

./configure --prefix=/usr/local/libxml2

make && make install


cd /home/lin/tar

tar zxvf jpegsrc.v6b.tar.gz

cd jpegsrc.v6b.tar.gz

./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static

make && make install

mkdir -p /usr/local/jpeg6

mkdir -p /usr/local/jpeg6/bin

mkdir -p /usr/local/jpeg6/lib

mkdir -p /usr/local/jpeg6/include

mkdir -p /usr/local/jpeg6/man

mkdir -p /usr/local/jpeg6/man1

mkdir -p /usr/local/jpeg6/man/man1



tar zxvf libpng-1.2.16.tar.gz

cd libpng

./configure 

make && make install


tar zxvf freetype-2.3.4.tar.gz

cd freetype-2.3.4

mkdir -p /usr/local/freetype

./configure --prefix=/usr/local/freetype

make && make install


tar zxvf  gb-2.0.35.tar.gz

mkdir -p /usr/local/gb

cd gd-2.0.35

./configure --prefix=/usr/local/gb \

--with-jpeg=/usr/local/jpeg6/ \

--with-png --with-zlib \

--with-freetype=/usr/local/freetype

make && make install


tar zxvf php-5.3.16.tar.gz

cd php-5.3.16

./configure -help|less


./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/http2/bin/apxs \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-freetype-dir=/usr/local/freetype \
--with-gd=/usr/local/gd2 \
--with-zlib --with-libxml-dir=/usr/local/libxml2 \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-png-dir \
--enable-mbstring=all \
--enable-mbregex \

--enable-shared 


ls |grep ini

cp php.ini-dist /usr/local/php/lib/php.ini

cd /usr/local/http2/

vi conf/httpd.conf

ls modules/

vi conf/http.conf

set nu

DirectoryIndex index.php index.html


AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php


bin/apachectl restart

cd htdocs/





这个配置文件允许fefault欢迎

如果没有默认页索引页的礼物

根url ,禁用欢迎页面,评论

所有下面的线

/etc/httpd/conf.d/welcome.conf.


cd /home/lin/

mv think /usr/local/http2/htdocs/

cd/usr/local/http2/conf/

vi httpd.conf  //打开vhost.conf

vi extra/httpd-vhosts.conf

DocumentRoot "/usr/local/http2/htdocs/think"

ServerName food.com


/usr/local/http2/bin/apachect1 restart


/usr/local /http2/ht docs/think 

默认目录是/var/www/html下。修改方法:
打开/etc/httpd/conf/httpd.conf文件,找到下面这行
DocumentRoot "/var/www/html"
可以改成你想要的目录。
-----------------------------------------------------------
apache的默认重要配置信息如下:
配置文件:/etc/httpd/conf/http.conf
服务器的根目录:/var/www/html
访问日志文件:/var/log/httpd/access_log
错误日志文件:/var/log/httpd/error_log
运行apache的用户:apache
运行apache的组:apache端口:80模块存放路径:/usr/lib/httpd/modules
 
 
http://www.server110.com/apache/201311/3222.html

导入数据库

/usr/local/mysql/bin/mysql -uroot -p

create database tp charset utf8;

use tp

导入数据库

mysql>source /usr/local/http2/htdosc/food/data.sql  

方法二:
mysql -u用户名 -p密码 数据库名 < 数据库名.sql
#mysql -uabc_f -p abc < abc.sql


导出数据库

D:

cd amp\mysql5.5\bin

mysqldump.exe -uroot -p111111 food > D:/food0827.sql


drop database food;

删除掉数据库

create database food charset utf8;

use food

source /home/lin/food0827.sql



mysqldump -u用户名 -p密码 数据库名 > 数据库名.sql
#/usr/local/mysql/bin/   mysqldump -uroot -p abc > abc.sql
敲回车后会提示输入密码

2、只导出表结构
mysqldump -u用户名 -p密码 -d 数据库名 > 数据库名.sql
#/usr/local/mysql/bin/   mysqldump -uroot -p -d abc > abc.sql

注:/usr/local/mysql/bin/  --->  mysql的data目录




 









































  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

solly793755670

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值