如何使用特使创建的符号链接在Apache中使用?

时间:2019-04-29 12:10:00

标签: apache ubuntu laravel-envoy

我使用的是使节安装,例如https://dyrynda.com.au/blog/an-envoyer-like-deployment-script-using-envoy: 并且我在ln命令成功运行时运行了脚本

  # Import the environment config
    echo 'Linking .env file';
    cd {{ $release_dir }}/{{ $release }};
    ln -nfs {{ $base_dir }}/.env .env;

    # Symlink the latest release to the current directory
    echo 'Linking current release';
    ln -nfs {{ $release_dir }}/{{ $release }} {{ $current_dir }};

如我所见,创建了指向新发布目录的符号链接。但是我不确定如何使用它?

在我的ubuntu服务器上安装了apache

我尝试创建新的配置目录但正在运行

a2ensite hostels2.com.conf 

然后重新启动apache我遇到了错误:

Apr 30 12:29:46 nsn-do-lamp systemd[1]: Starting The Apache HTTP Server...
Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: AH00112: Warning: DocumentRoot [/var/www/html/Hostels2Deployed/current/public] does not exist
Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: (2)No such file or directory: AH02291: Cannot access directory '/var/www/html/Hostels2Deployed/current/storage/logs/' for error log of vhost defined at /etc/apache2/sites
Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: AH00014: Configuration check failed
Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: Action 'start' failed.
Apr 30 12:29:46 nsn-do-lamp apachectl[6403]: The Apache error log may have more information.
Apr 30 12:29:46 nsn-do-lamp systemd[1]: apache2.service: Control process exited, code=exited status=1
Apr 30 12:29:46 nsn-do-lamp systemd[1]: apache2.service: Failed with result 'exit-code'.
Apr 30 12:29:46 nsn-do-lamp systemd[1]: Failed to start The Apache HTTP Server.

在我的/etc/apache2/sites-available/hostels2.com.conf中:

 <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/Hostels2Deployed/current/public
    ServerName myurl
    ServerAlias myurl

    <Directory /var/www/html/Hostels2Deployed/current/public>
      AllowOverride All
      Order Deny,Allow
      Allow from all
      Require all granted
    </Directory>

    Options FollowSymLinks
    DirectoryIndex index.php

    ErrorLog /var/www/html/Hostels2Deployed/current/storage/logs/error.log
    CustomLog /var/www/html/Hostels2Deployed/current/storage/logs/access.log combined
</VirtualHost>

我的envoy命令的输出具有。

7.4]: Step # 5 : Symlink set
[lardeployer@138.68.107.4]: Step # 50  : /var/www/html/Hostels2Deployed/release/20190430151627
[lardeployer@138.68.107.4]: Step # 5 : Symlink has been set current_dir : /var/www/html/Hostels2Deployed/current

但是在我的服务器上,我看到了错误的链接,但看不到为什么:

cd /var/www/html/Hostels2Deployed/current

https://imgur.com/a/Sw22oWh

谢谢!

0 个答案:

没有答案