We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
need LARAVEL templates nginx and httpd ?
-
- Posts: 25
- Joined: Mon Nov 24, 2014 11:48 pm
need LARAVEL templates nginx and httpd ?
hello,
if you want to use Laravel with VestaCP, you need to create template for nginx and httpd
to get :
/home/youruser/web/yourdomain.com/public_html/public
/public/= will be your default directory,
and all others directories from Laravel like /app, /bootstrap, /vendor.... will be under /public_html/
I share with you 4 files that you can include into VestaCP : httpd, httpd ssl, nginx, nginx ssl.
httpd:
httpd ssl
nginx
nginx ssl
if you want to use Laravel with VestaCP, you need to create template for nginx and httpd
to get :
/home/youruser/web/yourdomain.com/public_html/public
/public/= will be your default directory,
and all others directories from Laravel like /app, /bootstrap, /vendor.... will be under /public_html/
I share with you 4 files that you can include into VestaCP : httpd, httpd ssl, nginx, nginx ssl.
httpd:
Code: Select all
<VirtualHost %ip%:%web_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %docroot%/public/
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Directory %docroot%/public/>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid %user% %group%
RGroups apache
</IfModule>
<IfModule itk.c>
AssignUserID %user% %group%
</IfModule>
Include %home%/%user%/conf/web/%web_system%.%domain%.conf*
</VirtualHost>
Code: Select all
<VirtualHost %ip%:%web_ssl_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %sdocroot%/public/
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/
Alias /error/ %home%/%user%/web/%domain%/document_errors/
#SuexecUserGroup %user% %group%
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
CustomLog /var/log/%web_system%/domains/%domain%.log combined
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
<Directory %sdocroot%/public/>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All
</Directory>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile %ssl_crt%
SSLCertificateKeyFile %ssl_key%
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
<IfModule mod_ruid2.c>
RMode config
RUidGid %user% %group%
RGroups apache
</IfModule>
<IfModule itk.c>
AssignUserID %user% %group%
</IfModule>
Include %home%/%user%/conf/web/s%web_system%.%domain%.conf*
</VirtualHost>
nginx
Code: Select all
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
error_log /var/log/httpd/domains/%domain%.error.log error;
location / {
proxy_pass http://%ip%:%web_port%;
location ~* ^.+\.(%proxy_extentions%)$ {
root %docroot%/public/;
access_log /var/log/httpd/domains/%domain%.log combined;
access_log /var/log/httpd/domains/%domain%.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location @fallback {
proxy_pass http://%ip%:%web_port%;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include %home%/%user%/conf/web/nginx.%domain%.conf*;
}
nginx ssl
Code: Select all
server {
listen %ip%:%proxy_ssl_port%;
server_name %domain_idn% %alias_idn%;
ssl on;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/httpd/domains/%domain%.error.log error;
location / {
proxy_pass https://%ip%:%web_ssl_port%;
location ~* ^.+\.(%proxy_extentions%)$ {
root %sdocroot%/public/;
access_log /var/log/httpd/domains/%domain%.log combined;
access_log /var/log/httpd/domains/%domain%.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location @fallback {
proxy_pass https://%ip%:%web_ssl_port%;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include %home%/%user%/conf/web/snginx.%domain%.conf*;
}
-
- Posts: 25
- Joined: Mon Nov 24, 2014 11:48 pm
Re: need LARAVEL templates nginx and httpd ?
hello,
after added theses template file, I select "laravel" for nginx and httpd,
go under "users" menu, click "rebuild", and
the additionnal folder called "public" is not added to "public_html/public/" like described in theses templates files, why?
find an error under /var/log/httpd/error_log :
thx for any help.
after added theses template file, I select "laravel" for nginx and httpd,
go under "users" menu, click "rebuild", and
the additionnal folder called "public" is not added to "public_html/public/" like described in theses templates files, why?
find an error under /var/log/httpd/error_log :
Code: Select all
[Thu Dec 04 03:28:28 2014] [notice] SIGHUP received. Attempting to restart
Warning: DocumentRoot [/home/admin/web/test.com/public_html/public/] does not exist
Re: need LARAVEL templates nginx and httpd ?
sauvegardezvous99 wrote:hello,
after added theses template file, I select "laravel" for nginx and httpd,
go under "users" menu, click "rebuild", and
the additionnal folder called "public" is not added to "public_html/public/" like described in theses templates files, why?
find an error under /var/log/httpd/error_log :thx for any help.Code: Select all
[Thu Dec 04 03:28:28 2014] [notice] SIGHUP received. Attempting to restart Warning: DocumentRoot [/home/admin/web/test.com/public_html/public/] does not exist
Open usr/local/vesta/func/rebuild.sh and under rebuild_user_conf() { function find
Add below$HOMEDIR/$user/web/$domain/public_html \
Code: Select all
$HOMEDIR/$user/web/$domain/public_html/public \
Add belowchmod 751 $HOMEDIR/$user/web/$domain/public_html
Code: Select all
chmod 751 $HOMEDIR/$user/web/$domain/public_html/public
Add belowchown $user:$user $HOMEDIR/$user/web/$domain/public_html
Code: Select all
chown $user:$user $HOMEDIR/$user/web/$domain/public_html/public
I have not tested this so be careful
Re: need LARAVEL templates nginx and httpd ?
Mmh, when I create the tpl in correct folders, set chmod 755 and then rebuild everything and on the laravel app invoice ninja installed in web with a subdomain I change the web and the nginx template to the newly created, it says
and this is the error:"Error: apache2 restart failed"
I havent touched these files at all.* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 83 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/conf.d/vesta.conf: Could not open configuration file /home/admin/conf/web/apache2.conf: Permission denied
Action 'configtest' failed.
The Apache error log may have more information.
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 83 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/conf.d/vesta.conf: Could not open configuration file /home/admin/conf/web/apache2.conf: Permission denied
Action 'configtest' failed.
The Apache error log may have more information.
Re: need LARAVEL templates nginx and httpd ?
webass wrote: apache2: Syntax error on line 83 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/conf.d/vesta.conf: Could not open configuration file /home/admin/conf/web/apache2.conf: Permission denied
Code: Select all
ls -la /home/admin/conf/web/apache2.conf
Hehe, who make rubild and make changes? ;-)webass wrote:I havent touched these files at all.
Re: need LARAVEL templates nginx and httpd ?
thats the output...
So I guess you wanna say, that I MADE changes cause I created the file and the rights are not properly set?
becuase it gives error:
What should I do now, pls?
Code: Select all
-rw-r----- 1 root admin 22956 Apr 25 01:47 /home/admin/conf/web/apache2.conf
becuase it gives error:
Code: Select all
Could not open configuration file /home/admin/conf/web/apache2.conf: Permission denied
Re: need LARAVEL templates nginx and httpd ?
Nothing more in apache error log?webass wrote:What should I do now, pls?
/var/log/apache2/error.log
/var/log/apache2/domains/$domain.error.log
Re: need LARAVEL templates nginx and httpd ?
Not really:
This is from this morning.
But here:
Am trying to get invoiceninja.com to run in a web account, I just created the sub domain and installed all fine, only the site isnt reachable because /public folder is typical for Laravel ...
Then I added it to vhost but this didnt work, and I reverted. and then I tried the method with the template.
But the web server doesnt restart then.
Code: Select all
[Mon Apr 25 06:25:44.131739 2016] [:notice] [pid 13271] mod_ruid2/0.9.8 enabled
[Mon Apr 25 06:25:44.275277 2016] [mpm_prefork:notice] [pid 13271] AH00163: Apache/2.4.7 (Ubuntu) mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.16 OpenSSL/1.0.1f configured -- resuming normal operations
[Mon Apr 25 06:25:44.275291 2016] [core:notice] [pid 13271] AH00094: Command line: '/usr/sbin/apache2'
But here:
Code: Select all
root@mail:/var/log/apache2/domains# cat inv.lisbert.de.error.log
[Sun Apr 24 23:55:21.751183 2016] [autoindex:error] [pid 16801] [client 5.79.72.116:41903] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Apr 24 23:55:32.672613 2016] [autoindex:error] [pid 31672] [client 5.79.72.116:41906] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Apr 24 23:56:37.500882 2016] [autoindex:error] [pid 16799] [client 5.79.72.116:41910] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Apr 24 23:56:41.266995 2016] [autoindex:error] [pid 16800] [client 5.79.72.116:41911] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Apr 24 23:57:50.387896 2016] [autoindex:error] [pid 17470] [client 5.79.72.116:41915] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Sun Apr 24 23:57:58.516134 2016] [autoindex:error] [pid 17472] [client 5.79.72.116:41918] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Mon Apr 25 00:02:50.645306 2016] [autoindex:error] [pid 16359] [client 5.79.72.116:42091] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Mon Apr 25 00:08:08.599262 2016] [autoindex:error] [pid 16358] [client 5.79.72.116:42379] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Mon Apr 25 00:08:10.766917 2016] [autoindex:error] [pid 16356] [client 5.79.72.116:42382] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/ninja/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Mon Apr 25 00:09:58.870389 2016] [autoindex:error] [pid 16719] [client 5.79.72.116:42479] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
[Mon Apr 25 00:14:19.306725 2016] [core:alert] [pid 18893] [client 5.79.72.116:42541] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:14:26.582083 2016] [core:alert] [pid 18894] [client 5.79.72.116:42542] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:16:32.925939 2016] [core:alert] [pid 18895] [client 5.79.72.116:42560] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:16:36.250269 2016] [core:alert] [pid 19192] [client 5.79.72.116:42561] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:19:44.339073 2016] [core:alert] [pid 18894] [client 5.79.72.116:42575] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:19:46.625389 2016] [core:alert] [pid 18893] [client 5.79.72.116:42576] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:20:18.474318 2016] [core:alert] [pid 19805] [client 5.79.72.116:42585] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:20:22.136704 2016] [core:alert] [pid 19807] [client 5.79.72.116:42587] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:20:25.617210 2016] [core:alert] [pid 19808] [client 5.79.72.116:42588] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:23:39.481591 2016] [core:alert] [pid 19805] [client 5.79.72.116:42599] /home/admin/web/inv.lisbert.de/public_html/ninja/.htaccess: <IfModule not allowed here
[Mon Apr 25 00:44:13.664468 2016] [autoindex:error] [pid 20561] [client 5.79.72.116:42708] AH01276: Cannot serve directory /home/admin/web/inv.lisbert.de/public_html/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive
Then I added it to vhost but this didnt work, and I reverted. and then I tried the method with the template.
But the web server doesnt restart then.
Re: need LARAVEL templates nginx and httpd ?
The app is still not accessible. I start over new.
But I dont understand the issue.
I just wantd to create the app inside a web folder so every thing should be readable and accessible by user already.
But I dont understand the issue.
I just wantd to create the app inside a web folder so every thing should be readable and accessible by user already.
Re: need LARAVEL templates nginx and httpd ?
I cant get a laravel app called invoice nija installed.
I just cannot start the setup process. moved the public content to puiblic_html and the rest to private/app_data
no idea what the problem is.
In index.php also set the paths to
I dont use any nginx and apache template cause this also dont work, the apachje or ngnix wont restart.
I just cannot start the setup process. moved the public content to puiblic_html and the rest to private/app_data
no idea what the problem is.
In index.php also set the paths to
What is wrong??/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/../private/app_data/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../private/app_data/bootstrap/app.php';
// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
I dont use any nginx and apache template cause this also dont work, the apachje or ngnix wont restart.
and over and over this:[Sun Jun 12 00:09:31.502387 2016] [core:notice] [pid 13512] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 12 00:11:15.075957 2016] [mpm_prefork:notice] [pid 13512] AH00171: Graceful restart requested, doing restart
[Sun Jun 12 00:11:15.223809 2016] [:notice] [pid 13512] mod_ruid2/0.9.8 enabled
[Sun Jun 12 00:11:15.224877 2016] [mpm_prefork:notice] [pid 13512] AH00163: Apache/2.4.7 (Ubuntu) mod_fcgid/2.3.9 PHP/5.5.9-1ubuntu4.17 OpenSSL/1.0.1f configured -- resuming normal operations
[Sun Jun 12 00:11:15.224905 2016] [core:notice] [pid 13512] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 12 00:11:29.882143 2016] [mpm_prefork:notice] [pid 13512] AH00169: caught SIGTERM, shutting down
2016/06/12 00:27:02 [error] 24894#24894: *390 connect() failed (111: Connection refused) while connecting to upstream, client: 95.222.26.23, server: in.g-rrdia.de, request: "GET / HTTP/1.1", upstream: "http://3.12.33.116:8080/", host: "in.g-rrdia.de", referrer: "http://in.g-rrdia.de/"
[Sun Jun 12 00:06:37.534724 2016] [fcgid:warn] [pid 27873] [client 3.12.33.116:65500] mod_fcgid: stderr: PHP Fatal error: Class 'App' not found in /home/admin/web/in.g-rrdia.de/public_html/index.php on line 37
[Sun Jun 12 00:07:23.192837 2016] [:error] [pid 28537] [client 3.12.33.116:65512] PHP Fatal error: Class 'App' not found in /home/admin/web/in.g-rrdia.de/public_html/index.php on line 37