輕量應用伺服器配置虛擬主機

2021-10-02 08:49:38 字數 1947 閱讀 1107

輕量應用伺服器的apache和php在

/usr/local/目錄下
#listen 80

#documentroot "/home/www/htdocs"

## # possible values for the options directive are "none", "all",

# or any combination of:

# indexes includes followsymlinks symlinksifownermatch execcgi multiviews

## note that "multiviews" must be named *explicitly* --- "options all"

# doesn't give it to you.

## the options directive is both complicated and important. please see

# # for more information.

## options followsymlinks

## allowoverride controls what directives may be placed in .htaccess files.

# it can be "all", "none", or any combination of the keywords:

# allowoverride fileinfo authconfig limit

##allowoverride none

# allowoverride all

## controls who can get stuff from this server.

## require all granted

##proxypassmatch ^/(.*\.php(/.*)?)$ unix:/home/www/logs/php-fpm.sock|fcgi:

注釋掉上面的行,其中listen表示監聽的埠,documentroot表示應用的目錄,directory表示對目錄的許可權配置,proxypassmatch是fcgi的配置,也要注釋掉。

include conf/extra/httpd-vhosts.conf
這一行取消注釋,開啟虛擬主機配置。

listen 80

documentroot "/home/www/htdocs"

options indexes followsymlinks

allowoverride all

require all granted

proxypassmatch ^/(.*\.php(/.*)?)$ unix:/home/www/logs/php-fpm.sock|fcgi:

listen 8080

documentroot "/home/smart_home/source/php-solution/public"

options indexes followsymlinks

allowoverride all

require all granted

proxypassmatch ^/(.*\.php(/.*)?)$ unix:/home/www/logs/php-fpm.sock|fcgi:

虛擬主機的中配置,需要注意的是proxypassmatch結尾的路徑需要與documentroot 中的路徑一致。並且還需要在php.ini中配置好open_dir,才能讓cgi正確訪問

open_basedir="/tmp/:/home/www/htdocs/:/home/smart_home/source/php-solution/"
php.ini中的配置

配置完成後重啟主機。

node輕量應用伺服器

mongodb curl o 2 解壓 tar zxvf mongodb linux x86 64 3.2.9.tgz 3建立資料資料夾和日誌檔案等 mkdir p usr local mongodb mongodb 3.29 data touch usr local mongodb mongodb...

阿里輕量應用伺服器搭建Tomcat

一 購買伺服器 這裡我糊里糊塗的買了輕量級應用伺服器,然後花費了大量的時間搭建了乙個tomcat,中間也是各種坑,這裡就分享一下,希望能幫助到後來人吧。這裡伺服器的系統為centos7 二 安裝jdk linux centos 7 jdk 1.7 安裝與配置 三 安裝tomcat 2 解壓 tar ...

阿里雲輕量應用伺服器 搭建配置詳解

好久沒有更新部落格了,說來也是慚愧沒有養成記錄經驗的習慣。有很多技術開發同學都想擁有自己的伺服器用來搭建個人 或者展示作品,但是怕租上不會配置或者嫌配置繁瑣難下決定。廢話不多說直接進入正題,前兩天幫朋友配置一台阿里雲的輕量應用伺服器 注意不是雲伺服器ecs但是大同小異 伺服器規格 我配置的是1gb記...