Configure Laravel using Virtualmin on Ubuntu 20.04 - mysql

I have recently migrated to a new server, which now uses virtualmin. I'm trying to configure laravel on the new server, but am having trouble with it and cannot find any examples online.
I have downloaded the laravel-project from the old server and saved it in the following directory on the new server:
/home/domain/public_html/laravel-project
My DocumentRoot in /etc/Apache2/sites-available is:
DocumentRoot /home/domain/public_html/public
I have the following set up in /etc/host:
MYSQL server listening address (IP) laravel-project
My .env file is pointing to the same MySQL server listening address
My index.php file within /home/domain/public_html/laravel-project/public has the following line:
$app = require_once __DIR__.'/../bootstrap/app.php';
I have the following output in the error log:
[Wed Jun 02 13:26:44.163271 2021] [authz_core:error] [pid 1579245:tid 140072238184192] [client 141.101.98.53:14020] AH01630: client denied by server configuration: /home/domain/public_html/public
Any advice would be much appreciated.

I had the same problem i solved it with
try to upload the application via Virtualmin file manager (.zip) and check Extract Compressed.
move all the folders and files from laravel-project to the public_html folder so that it becomes public_html/app public_html/public etc.
No need to change .conf, you just need to change folder path in virtualmin->server configuration->website options and input your path to change website document sub-directory

Related

How to run a html file on localhost (any port)

I am creating a website using HTML, CSS and js with java for server side. I need to run it on localhost.
Extra info: I am using mac os x 11 (el capitan)
I have already tried python and node.js but it clashes with java
So i need a technology that won't clash with java and will help me localhost on mac
IIRC macOS comes with PHP preinstalled, and PHP has built-in web-server which should be enough for serving static content.
So, open Terminal.app and then:
cd your/project/dir
php -S localhost:8080
After than you can navigate to http://localhost:8080/ and see your site in the browser (given you have index.html in your project, otherwise there will be "Not Found" message).
There are more advanced and/or less terminal-oriented ways, of course, but since you already tinkering with python and node, another terminal command should not be a problem.
BTW, you might want to look at that terminal window from time to time, as it outputs nice log of what things were requested from server. Good if you want to check for invalid references, 404 errors, etc. Here is a sample output:
$ php -S localhost:8080
PHP 7.3.6 Development Server started at Sat Jun 22 20:00:28 2019
Listening on http://localhost:8080
Document root is /private/tmp/test
Press Ctrl-C to quit.
[Sat Jun 22 20:00:32 2019] [::1]:51640 [200]: /
[Sat Jun 22 20:00:32 2019] [::1]:51641 [200]: /style.css
[Sat Jun 22 20:02:35 2019] [::1]:51670 [404]: /oops.html - No such file or directory
As you can see, root folder (/, which was translated to index.html in my case) and a stylesheet (style.css) were requested and successfully delivered (code is 200). But non-existent file oops.html resulted in error (code is 404).
You can use caddy
Install: brew install caddy
To serve static files from the current working directory, run:
caddy file-server --browse --listen :2015
Caddy's default port is 2015, so open your browser to http://localhost:2015.

SFTP transfer using Execute Process Task and WinSCP in SSIS

I am having a User_file.txt file placed at WinSCP root folder USERDATA, which I am trying to download to the given location C:\User\Local\.
Executable- C:\Program Files (x86)\WinSCP\WinSCP.exe
Arguments - /log=c:\path\to\log\winscp.log /command "open ftp://username:password#example.com/" "get /USERDATA/User_file.txt C:\User\Local\" "exit"
I am facing below error:
No connection could be made the target machine actively refused it
Not sure what I am missing. I took reference from couple of related post on Stack Overflow.
You want to use SFTP, but use FTP (ftp://) protocol in the session URL.
Use sftp:// instead:
... "open sftp://username:password#example.com/" ...
WinSCP GUI can generate a correct script/command-line template for you.

Setting up Ghost on Subdomain with Hidden Port - Windows Server 2008 with Apache

Before I start, I should say I am running XAMPP on Windows Server 2008 R2. I have node.exe allowed through my firewall, as well as port 2368. I have also been following the instructions here with no success.
I have my Ghost installed here.
As you can see, Ghost is only loading with the port as part of the web address.
If you try and load the site without the port like so, you get an Internal Server error.
My vHosts file for Ghost is:
<VirtualHost *:80>
ServerName blog.theobearman.com
ProxyPreserveHost on
ProxyPass / http://127.0.0.1:2368/
</VirtualHost>
My config.js file is here. Please note that 198.37.105.108 in the config file is the IP of my server.
Error logs for the Internal Server error are as follows:
[Fri May 15 17:56:25.495296 2015] [proxy:warn] [pid 56352:tid 1580] [client 86.147.117.154:58787] AH01144: No protocol handler was valid for the URL /error/HTTP_INTERNAL_SERVER_ERROR.html.var. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: http://blog.theobearman.com/
I would appreciate it if somone could tell me what I need to do so that when you navigate to "http://blog.theobearman.com", Ghost will load without the need for the port as part of the web address.
Thanks in advance!
You likely need to enable the proxy module for Apache:
# Enable the modules.
a2enmod proxy_http
a2enmod proxy
# Restart Apache
service apache2 restart

Postfix don't receive emails

I have configured postfix from this tutorial:
http://www.howtoforge.com/virtual-users-and-domains-with-postfix-courier-mysql-and-squirrelmail-debian-wheezy
I can succesulfy send email but can't receive.
Informations from /var/log/mail.log
Oct 30 15:51:56 Debian-76-wheezy-64-minimal postfix/lmtp[31594]: C9E97C40E7D: to=, relay=none, delay=0.1, delays=0.08/0.02/0/0, dsn=4.4.1, status=deferred (connect to mail.xxxxxx[private/dovecot-lmtp]: No such file or directory)
mailq info:
root#Debian-76-wheezy-64-minimal /home/vmail/xxxxx/admin # mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
1AE0FC40E7F 1367 Thu Oct 30 15:53:53 yyyyyy#uuuuuu
(connect to mail.precyl.com[private/dovecot-lmtp]: No such file or directory)
admin#xxxxxxx
Anyone have idea how to fix it? I'm trying so hard and don't have any ideas
Go to /var/ and change the privileges of the folder /var/mail accordingly by right click on the folder and going to "Properties", then go to the "Permissions" tab; if you change everything to "Change and Delete files" will work for sure but change accordingly!
Are you sending from an email client or direct from the server? If you are using a email client try to send it from the server using the terminal:
How to send email from Terminal?
Check /etc/postfix/main.cf for "mynetworks" var. Maybe you are blocking for localhost use only.
mynetworks = 127.0.0.0/8
Hope it helps.

Smtp error 451 Temporary local - please try later on Cpanel Server

I have a Cpanel Server.
It send emails correctly expect from 1 domain which hosted on the server , so when I try to send email from that domain using roundcube or Horde I got the errror
SMTP Error (451): Failed to add recipient "recipient#exmple.com" (Temporary local problem - please try later).
does anyone know why and how to fix this?
I found the porblem:
After reviewing the file /var/log/exim_mainlog using
tail -f /var/log/exim_mainlog
I noticed that the error was:
2013-05-29 20:04:28 SMTP connection from [127.0.0.1]:36797 (TCP/IP connection count = 1)
2013-05-29 20:04:28 lowest numbered MX record points to local host: domain.com (while verifying <user#domain.com> from host localhost.localdomain (domain.com) [127.0.0.1]:36797)
2013-05-29 20:04:28 H=localhost.localdomain (domain.com) [127.0.0.1]:36797 sender verify defer for <user#domain.com>: lowest numbered MX record points to local host
2013-05-29 20:04:28 H=localhost.localdomain (domain.com) [127.0.0.1]:36797 F=<user#domain.com> A=dovecot_login:narena temporarily rejected RCPT <recipient#exmple.com>: Could not complete sender verify
2013-05-29 20:04:28 SMTP connection from localhost.localdomain (domain.com) [127.0.0.1]:36797 closed by QUIT
so the main problem was:
lowest numbered MX record points to local host
after couple of search I found the soluation in http://forums.cpanel.net/f5/lowest-numbered-mx-record-points-local-host-73563.html
which was to:
login to WHM and go to Main >> DNS Functions >> Edit MX Entry for the domain
set MX priority to 0 for the related domain and save.
I had the same problem after running a script to fix directory permissions on a cPanel-powered server (CentOS 6.5). I checked the logfile (tail -f /var/log/exim_mainlog) and found this error:
require_files: error for /home/user_name/etc/domain.com: Permission denied
Just ran the following command and the issue was fixed:
chown -R user_name:mail /home/user_name/etc/
Hope this helps someone.
check the the file /var/log/exim_mainlog to see more information about the error
tail -f /var/log/exim_mainlog
while trying to send email
Check your MX Entry in Cpanel, if the existing domain priority is less than or equals to 0, set it to 1. Mine is fixed. Hope it will help you.
Wow, after about an hour of searching and meddling with different files, I'd caution any novice not to venture out editing anything before you have a backup or image if your server, as you can cause irrevocable damage to your server. So many people talking garbage about what you should do or test without any real solution.
Anyways, here's what worked for me:
Real problem: Exim was updated to latest version which has loads of bugs like this issue.
How I fixed my server:
Authenticate to Linux via SSH and run the command lines through which we download and install the old version of EXIM.
Command Line 1: wget https://ca1.dynanode.net/exim-4.93-3.el7.x86_64.rpm
Command Line 2: rpm -Uvh --oldpackage exim-4.93-3.el7.x86_64.rpm
Command Line 3: systemctl restart exim
Command Line 4: Systemctl restart clamd
Command Line 5: systemctl restart spamassassin
Optional: just type "Reboot" to restart your server
The command lines above does the following:
Downloads the old package (I'm sure you can google other sources with this file)
Install the old package without prompt
Restart the Exim service
Restart the Clamd Service (AV)
Restart the spamassassin service (Spam Filter)
Restart outlook or whatever you use for mail client and send an email. Mine works, hope yours do too.