Shows only default page in ubuntu using valet-linux - linux

I installed valet-linux in kubuntu 18.04 and followed the documentation. I also changed the path to make valet command works. I also added the directory of my projects which is located in another partition using valet park and change its port to 8888 so it won't have conflict with apache which listens to port 80.
But when I run my-laravel-project.test it shows the Apache2 Ubuntu Default Page not my laravel project page which when I tested it using php artisan serve, it is working. Thanks!

I experienced the same.
Can you check if valet is running correctly?
valet status
In my case it looked like this:
Php7.2-fpm is running...
Nginx is stopped...
So I fixed it by stopping, apache since it was obviously interfering with valet:
sudo service apache2 stop
I checked the status again
valet status
and now it looked fine:
Php7.2-fpm is running...
Nginx is running...
Now Valet worked for me on Ubuntu.

add DirectoryIndex index.php to your apache config

Related

Plesk Obsidian - docker domain proxy not working

I have a problem with my Plesk server. I am using Plesk Obsidian 18.0.28 on Ubuntu Server.
I have a custom nodejs api inside a container up and running.
If I type domain.tld:3000, I get "ok" as response as expected and my api is accessible.
I added a proxy rule to proxy api.domain.tld to the running docker container, but when I visit the domain, I get an 403 Error as response.
Do I need to make some settings changes anywhere in plesk to get this to work? This does not work
with other containers either.
I appreciate every helpful hint I can get.
I found the error:
nginx was not installed & plesk installer was crashed
If I clicked on tools & settings => plesk => updates & upgrades the page was loading forever. Normally you can install nginx there.
Solution:
Log into your terminal (e.g. via putty)
Install nginx reverse proxy with: plesk installer --select-release-current --install-component nginx
If you get an error message, that an installer is already running, you can force that plesk installer to stop with: plesk installer stop
After you installed nginx, you just need to start it once manually.
For more information, see here: https://support.plesk.com/hc/en-us/articles/213944825-How-to-install-and-enable-nginx-reverse-proxy-on-a-Plesk-for-Linux-server
and here: https://support.plesk.com/hc/en-us/articles/213917525-Unable-to-open-the-Updates-and-Upgrades-page-or-start-Plesk-Installer-in-CLI-Update-operation-was-locked-by-another-update-process
But I'm still confused why I got no error message at all when trying to use proxy rules without nginx.

How do I automatically start a node/express app (with pm2), having node installed using software collections (scl), on CentOS7

1. Summarize the problem
I would like for a node/express app.js to listen on a port 3000, on container startup.
I created a CentOS 7 Docker container, installed the software collections (SCL) repo, and then installed node.
I can now enable node with:
scl enable rh-nodejs10 bash, and so I did, and then installed express (globally), and pm2 (globally), and can successfully run a minimal express app listening on port 3000 with commands I run at the command line.
I put scl enable rh-nodejs10 bash in my .bash_profile (of a user I created named: www - because I do not want root running the web server).
In fact, I will be building a rootless container (buildah), next after this, so there will be no 'root' user at all for security concerns.
Now on container startup I want to have the web server start automatically, and be able to get a response from: http://localhost:3000 (hello world).
The problem is that on container startup, node is not enabled for any user until a shell is invoked to enable it.
2. Provide background including what you've already tried
I have searched the web for a solution of using node, express, pm2 in conjunction with CentOS 7 software collections and have found no solution.
Please only reply if you have actually tried the solution your recommend, and have it working, otherwise it most likely will not work.
systemd needs to:
1. enable node
2. run pm2 start app
I tried putting both in a shell, but when you enable node, you are then put in a sub-shell and cannot script any additional commands.
3. show some code
scl enable rh-nodejs10 bash
4. Describe expected and actual results including any error messages
I expect the node/express server to listen on port 3000 on container startup.
I have node running on reboot on RHEL 7 by using scl-utils/scl_source technique found here
$ cat /etc/profile.d/enablenodejs.sh
#!/bin/bash
source scl_source enable rh-nodejs10

Installed gitlab-omnibus 8.16 on debian vps - now how do I reach it?

Really sorry to ask such a dumb question here, it's been 10y since I configured anything on a webserver.
I have a vserver with debian and the usual control panel stuff on it.
I installed gitlab-omnibus 8.16, all services seem to be running on shell
entering the IP displays the contents from standard debian apache webroot var/www with the control panels and everything, those are working
As I guess gitlab uses nginx, it should be independent from apache, so sites-available etc. won't have any effect. What do I have to configure?
Use:
sudo systemctl stop apache2
and
sudo systemctl disable apache2
Make sure gitlab is using nginx in gitlab.rb
Then restart gitlab
sudo gitlab-ctl restart
Now use ip at port 80.
As I guess gitlab uses nginx, it should be independent from apache, so
sites-available etc. won't have any effect. What do I have to
configure?
Gitlab is bundled with nginx but you can disable it. Then Gitlab may be used with Apache HTTP server. It depends on your preference. Example configuration for Gitlab with Apache:
Configure gitlab with apache2 (or nginx + apache2)

Using a Cron Job to check if my mod_wsgi / apache server is running and restart

my group and I are running a server that is based upon Django and uses mod_wsgi to run an Apache server. We will not be working on this project after it is over, so I am attempting to set up cronjob similar functionality to check if the apache server has shut down(system restart or power failure), and if it has, will restart the server for me. I've found documentation on how to check if an apache server is down and restart the server if it is, but our server uses https and thus our start command is pretty verbose.
Can I simply use the functionality provided in these examples:
https://askubuntu.com/questions/277389/cron-job-to-restart-apache
https://www.digitalocean.com/community/tutorials/how-to-use-a-simple-bash-script-to-restart-server-programs
Or do I need a much more complicated process to make this happen?
The command we use to initially start the server is
python manage.py runmodwsgi --host 0.0.0.0 --port 8001 --https-port 8000 --ssl-certificate (certificate Location) --server-name (Domain Name)
I'm pretty new to Linux and using both Mod-wsgi as well as Apache so any help is greatly appreciated.
I suppose it is not good way to resolve this problem.
I recommend you use monit (https://mmonit.com/). It is cool program for checking services.
apt-get install monit
Apache restart configuration directives:
check process httpd with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80
protocol http then restart
if 5 restarts within 5 cycles then timeout
You are better off using the --setup-only option to mod_wsgi-express or the Django integration for it, to generate the configuration but not run it. Then as others have mentioned, integrate it into the system service manager.
The two commands for starting and stopping the Apache/mod_wsgi instance would be apachectl start and apachectl stop, where apachectl is that which was generated when running with the additional --setup-only option.
When running it as a system service, also make sure you use the --server-root option to specify a more persistent location for the generated configuration. Do not use the default under /tmp if running for anything but temporary development sessions as some Linux systems will remove files under /tmp causing things to start failing after a while.
Also, since under a service manager it would generally be starting as root, particularly if listening on port 80 is a requirement, ensure you use the --user and --group options to specify what user/group your Python web application should run as.
Read:
https://pypi.python.org/pypi/mod_wsgi
for more details of the --setup-only option and start-server commands for generating the configuration. Because you are using the Django integration, you will need to use the --setup-only option.
For more informed helped, bring your issue to the mod_wsgi mailing list. The mod_wsgi-express way of running Apache/mod_wsgi is new enough that unlikely that anyone here is really going to know much about it.
There is no need to do this at all. There is no reason to start up Apache manually; once it's installed as a system service, Ubuntu will start it up automatically on restart or crash.
You should reflect on why you feel the need to do this for Apache specifically, and not any of the other system services you depend on, such as the database.

apache2 cannot be restarted :Action 'start' failed

I have a linux server that contains many websites under vhosts, once I deleted an alt site the apache2 coud not be restarted indecating this message in the error log:
#eror log
(2)No such file or directory: apache2: could not open error log file /var/www/vhosts/deleted_Site/logs/error.log.
Unable to open logs
How can I stop that so I can start my apache2
You should modify your apache configuration, for instance in conf.d/, all configuration related to your old website, especially for error logs (look for access logs and errors logs directives specification, somewhere in your conf files, apache2.conf, httpd.conf, sites-enabled, mods or what/wherever it is).
To resolve this error, you need to stop other process using same port. In some of cases it is nginx. you can stop it
sudo /etc/init.d/nginx stop
Turn off any servers using the same port. For example to turn off nginx try this:
sudo systemctl stop nginx

Resources