標籤:style blog http io color ar os sp for
1.先安裝openssl,雖然一般自己用不到https 下載安裝包,解壓
tar -xzf openssl-xxx.tar.gz
看下configure項
[email protected]:~/openssl-1.0.1j$ ./Configure --helpUsage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]
這裡就用基礎選項裝一下
./config --prefix=/usr/local/ --shared
make & make install 二連
make & make install (需要root許可權)
裝完之後看下是否裝成功
[email protected]:~/openssl-1.0.1j$ openssl versionOpenSSL 1.0.1j 15 Oct 2014
當然像unbuntu直接用apt-get也ok:
sudo apt-get install opensslsudo apt-get install libssl-dev
2.安裝apache
下載apache安裝包,解壓,進目錄,執行
./configure --prefix=/usr/local --enable-so --enable-rewrite --enable-ssl --with-ssl=/usr/local/ssl --enable-module=mostmakemake install
安裝完成後,去bin目錄啟動apache
sudo ./apachetl -k start
開啟預設地址http://localhost/,如果顯示it works證明安裝基本成功
3.安裝ci
直接下載ci的安裝包,解壓縮到自己指定的目錄下面,如/usr/local/ci/,配置以後再配
4.安裝php5
先嘗試編譯安裝php5,結果要先安裝libxml,就先裝下
sudo apt-get install libxml-dev
順便把mod-php5也裝了
sudo apt-get install libapache2-mod-php5
再進行php5的比哪一安裝
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/lib --with-mysql
copy一份設定檔到lib目錄
sudo cp -p /usr/share/php5/php.ini-development /usr/local/php5/lib/php.ini
5.修改apache配置
需要將apache的目錄指向ci目錄,同時讓apache支援php
修改httpd.conf,主要是路徑、許可權以及php檔案:
DocumentRoot "/usr/local/ci"<Directory "/usr/local/ci"> Options -Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>DirectoryIndex index.html index.php
找到 AddType application/x-gzip .gz .tgz 在其下添加如下內容
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
httpd-vhosts.conf也加下路徑
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/usr/local/ci" ServerName wepay.oa.com ErrorLog "logs/wepay.com-error_log" CustomLog "logs/wepay.com-access_log" common </VirtualHost>
這樣設定完重啟,訪問配置的網域名稱,就可以看到ci的預設頁了
6.修改ci的配置
不過如果將已有的ci架構放進去可能會報錯Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php 在index.php設定system目錄和application目錄為自己的路徑
$system_path = ‘/usr/local/php_platform‘; if(!is_dir($system_path)){ $system_path = ‘../module/system‘; } $application_folder = ‘../module/application‘;
進一步設定ci的一些路徑配置,設定檔主要在application/config/設定基礎url
vim application/config/config.php
設定$config[‘base_url‘] = ‘http://wepay.oa.com/‘;
在routes.php下面修改預設頁設定
$route[‘default_controller‘] = "welcome";
其他配置酌情修改
安裝apache+CI