OTRS doesn't start on apache2 - bash

I'm setting up otrs server on apache2, but when I start up apache2 service I just get default apache2 page even though I already configured otrs.conf in /sites-avaible/ This is following steps I took:
ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/sites-available/otrs.conf
a2ensite otrs.conf
service apache2 reload
Console Image

disable default site: a2dissite 000-default.confdouble check your config at otrs.conf – LasVegasCoder
also had to add few commands
a2dissite 000-default
a2dissite otrs.conf
service apache2 reload
a2ensite otrs.conf
service apache2 reload

Related

Auto boot MailHog on Ubuntu 20.04

I installed MailHog in my staging environment by following these steps:
sudo apt-get -y install golang-go
go get github.com/mailhog/MailHog
In order to manually start the service I do:
cd ~/go/bin
./MailHog
Since I'm using Laravel I already have supervisor running for workers.
I'm wondering if there is a way to add a new .conf file in order to start MailHog.
I tried to follow how Laravel workers are started, but so far no luck
[program:mailhog]
process_name=%(program_name)s_%(process_num)02d
command=~/go/bin/MailHog
user=ubuntu
stdout_logfile=/var/www/api/storage/logs/mailhog.log
I get mailhog:mailhog_00: ERROR (no such file) when I try to start supervisor.
I need a way to auto boot MailHog, no matter if I need supervisor or via services.
I'll really appreciate it if you can provide the "recipe" for starting MailHog from the supervisor or by using a service.
I figure out how the complete installation/setup should be:
Downloading & installation
sudo apt-get -y install golang-go
go get github.com/mailhog/MailHog
Copy Mailhog to bin directory
sudo cp ~/go/bin/MailHog /usr/local/bin/MailHog
Create MailHog service
sudo tee /etc/systemd/system/mailhog.service <<EOL
[Unit]
Description=MailHog
After=network.target
[Service]
User=ubuntu
ExecStart=/usr/bin/env /usr/local/bin/MailHog > /dev/null 2>&1 &
[Install]
WantedBy=multi-user.target
EOL
Note: Change the User=ubuntu to your username.
Check status service is loaded successfully.
sudo systemctl status mailhog
Output
mailhog.service - MailHog
Loaded: loaded (/etc/systemd/system/mailhog.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Start service
sudo systemctl enable mailhog
Reboot system and visit http://yourdomain.com:8025/
You don't need a supervisor, you can use Linux systemd to create a startup application.
systemd is the standard system and service manager in modern Linux. It is responsible for executing and managing programs during Linux startup
before that add mailhog to your system path variable to call it only by name
export PATH=$PATH:/home/YOUR-USERNAME/go/bin/MailHog
sudo systemctl enable mailhog
or if you are using any desktop environment , you can follow this
https://askubuntu.com/questions/48321/how-do-i-start-applications-automatically-on-login

How can I enable an Apache module on ddev?

I'm using webserver-type: apache-fpm with ddev and need to enable a module. How do I do that?
Probably the best way to do this is with a .ddev/web-build/Dockerfile based on this one (if you needed hearteat module):
ARG BASE_IMAGE
FROM $BASE_IMAGE
RUN a2enmod heartbeat
That will enable a module long before apache actually comes up, so if you have an apache config that depends on the module, it will work OK.
An alternate technique is to use a2enmod inside the web container and then apachectl graceful to restart apache to pick up the changes.
So ddev ssh and then a2enmod heartbeat && apache2ctl graceful (if you were enabling the "heartbeat" module)
Using ddev exec: ddev exec "a2enmod heartbeat && apache2ctl graceful"
Using a post-start hook:
hooks:
post-start:
- exec: a2enmod heartbeat && apache2ctl graceful

Not found error on setting up local server using LAMPP

When I enter localhost/hello.php in my browser, I get below error.
Not Found
The requested URL /hello.php was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
I think there is some compatibility issue in the LAMPP and Ubuntu.
To start apache2 normally you need to first hard stop it through following command:
Sudo service apache2 stop.
And then restart the apache2 or LAMPP . This worked for me.

Laravel all routes except '/' return 404 on AWS EC2

I'm trying to run Laravel project on AWS EC2. It was working fine until uploaded a new version to deploy. All routes return error 404 except for '/' though all routes exist. httpd.conf in /etc/httpd/conf contains this
<Directory "/var/www">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
I always execute these commands after deploying a new version
sudo chown -R ec2-user /var/app/current
sudo chmod -R 755 /var/app/current
I tried "sudo a2enmod rewrite" but I get "sudo: a2enmod: command not found"
Any solution?
Replacing the instance and re-deploying the app solved the problem
After modifying /etc/httpd/conf/httpd.conf
You need to also restart httpd using sudo service httpd restart
Refer to Laravel ReST API URL 404 not found on AWS EC2 in Apache + mySQL environment - The request URL was not found on this server

How to redirect requests from apache2 to tomcat7 on Amazon EC2 Ubuntu12.04 when installed using apt-get command

I installed Apache2 and Tomcat7 on Amazon EC2 Ubuntu12.04 using command:
sudo apt-get install apache2
sudo apt-get install tomcat7
Now for tomcat
CATALINA_HOME is /usr/share/tomcat7 (bin and lib folders of tomcat)
CATALINA_BASE is /var/lib/tomcat7 (webapps folder is in there)
For Apache
Apache modules : /etc/apache2/mods-enabled
virtual hosts : /etc/apache2/sites-enabled
configuration file : /etc/apache2/apache2.conf
Apache configuration file httpd.conf is empty.
How can I redirect all request from Apache2 to Tomcat7?
Means for Example if I enter 10.121.143.116:80 in browser, it will hit 10.121.143.116:8080
Kindly suggest as I am finding on google since last 2 months and found too many solutions all mix up and not able to understand single best working solution.
Hope this will help.
First, create sampleweb file in /etc/apache2/sites-available
sudo touch /etc/apache2/sites-available/proxy_your_sampleweb
Second, add the following in above sampleweb host file.
sudo vi /etc/apache2/sites-available/proxy_your_sampleweb
#For forwarding everything
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
Third, enable sampleweb site
sudo a2ensite proxy_your_sampleweb
Forth, reload apache2 configuration
sudo service apache2 reload
Fifth, access your tomcat app using 80 port.
http://<>/
if you want to redirect only specific context like sampleweb, you can customise the above to limit only your sampleweb request to tomcat.
sudo vi /etc/apache2/sites-available/proxy_your_sampleweb
#For forwarding only required contexts
ProxyRequests Off
ProxyPass /sampleweb http://localhost:8080/sampleweb
ProxyPassReverse /sampleweb http://localhost:8080/sampleweb

Resources