对于OSA安装过程中进行到如下步骤要求运行install/auto_prepare.sh

OSA

按提示在中断运行install/auto_prepare.sh后提示以下错误

install error!
Your script into the path:/dev/pts/0/osa/ctrlphp/install or /dev/pts/0/osa/.
exp: /usr/local/osa/auto_prepare.sh or /usr/local/osa/ctrlphp/install/auto_prepare.sh .

经排查为auto_prepare.sh脚本中获取脚本路径出错,修改auto_prepare.sh脚本

将第9行:

INSTALL_PATH=$(dirname $(readlink /proc/$$/fd/255))

更改为:

INSTALL_PATH=$(dirname $(dirname $(pwd)))

然后重新执行脚本即可。

osa_install

以批量设置文件夹所有人为例:

find ./ -name html -type d -exec chown -R www-data:www-data {} \;

./表示要查找的目录,此处表示在当前目录下查找

html表示要查找的目录或文件名

-type d 表示只查找文件夹

-exec 命令 {} \; 表示对查找结果要执行的命令

注意:此处{}和\;之间要有空格,否则会报“遗漏 ·-exec·命令”

chown -R www-data:www-data 是要执行的命令,此处指更改目录及其子目录的所有者为www-data

 

 

1、多域名调用Ueditor的配置:

默认状态下,会出现如(ueditor Protocols, domains, and ports must match.)的跨域访问错误。

修改ueditor/ueditor.config.js,将URL写成固定值ueditor的路径即可

1111111

2、上传文件路径配置

默认状态下,从编辑器上传的图片都是相对路径。

修改/ueditor/php/config.json,将配置文件中imageUrlPrefix参数全部设置域名前缀。

2222222

 

1、修改APACHE配置文件httpd.conf

修改加载模块

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

2、修改虚拟目录配置httpd-vhost.conf

ServerName ?www.test.com #设置需要代理的域名

ServerAias ?www.test.com

Options MultiViews

AllowOverride None

Order allow,deny

Allow from all

ProxyPass / http://192.168.0.2/ ? ?#设置代理目标服务器及访问的目录

ProxyPassReverse / http://192.168.0.2/

ErrorLog "/log/www.test.com-error.log"

Transferlog "/log/www.test.com-access.log"

3、重启apache服务器生效

cd /data/apache/bin

./apachectl restart

输入正文$text,使用正则替换后去除标签。

代码如下: $pattern = "/(]+>)(]+>)(<[^>]+>)/is"; $replacement = '$2'; $result = preg_replace($pattern, $replacement, $text); echo $result;