我有一个运行 openVZ 和 CentOs 6 的 VPS 服务器,我想在上面安装 openVPN。我遵循了本教程:https : //www.digitalocean.com/community/tutorials/how-to-setup-and-configure-an-openvpn-server-on-centos-6 但我无法启动 openVPN服务:
Starting openvpn: [FAILED]
Run Code Online (Sandbox Code Playgroud)
这就是我的/var/log/messages/
文件中的内容:
Mar 9 10:50:50 s18194633 openvpn[19715]: event_wait : Interrupted system call (code=4)
Mar 9 10:50:50 s18194633 openvpn[19715]: /sbin/ip route del 10.8.0.0/24
Mar 9 10:50:50 s18194633 openvpn[19715]: ERROR: Linux route delete command failed: external program exited with error status: 2
Mar 9 10:50:50 s18194633 openvpn[19715]: Closing TUN/TAP interface
Mar 9 10:50:50 s18194633 openvpn[19715]: /sbin/ip addr del dev tun0 local 10.8.0.1 peer 10.8.0.2 …
Run Code Online (Sandbox Code Playgroud) 我有自己的带有 CentOS 6 和 nginx 的 VPS,我想启用缓存。为了测试它,如果它成功启用,我使用 Google PageSpeed Insight。我的问题是我没有太多经验,我必须启用缓存以及我可以设置图像的缓存时间等等。这就是我在互联网上找到并尝试过的内容:
/etc/nginx/sites-available
并且/etc/nginx/sites-enabled
因为它们以某种方式不存在。/etc/nginx/nginx.conf
添加include /etc/nginx/sites-enabled/*;
}
创建文件/etc/nginx/sites-available/my-site.com.conf
:
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 15d;
}
location ~* \.(pdf)$ {
expires 30d;
}
Run Code Online (Sandbox Code Playgroud)
}
链接conf文件: ln -s /etc/nginx/sites-available/my-site.com.conf /etc/nginx/sites-enabled/my-site.com.conf
service nginx restart
我将我的网站用于 WordPress。
因此,每当我使用 PageSpeed Insight 或其他 pagespeed 工具测试我的页面时,它都会说我不为 header.png、javascripts 等使用缓存。但是我没有收到一些错误,即使我检查了nginx -t
显示此内容的配置文件:
nginx: the configuration file …
Run Code Online (Sandbox Code Playgroud)