apache2 same with httpd - apache

I've installed apache2 using apt-get into /etc/apache2.
Later I manually compiled and installed httpd2.4 into /usr/local/apache2/.
I've seen post like: My httpd.conf is empty which says that basically apache2.conf is in current use while httpd.conf is preserved for historic reason.
And before installing httpd, the apache2 works fine.
So my question:
Are Apache2 and httpd the same thing?

Related

How to use httpd command instead of apache2 on Ubuntu?

Is there a way to create httpd as an alias on Ubuntu that points to apache2? I'd like to be able to use the systemctl reload httpd and systemctl reload apache2 commands interchangeably, since I often use both CentOS and Ubuntu.

Amazon EC2 hide phpmyadmin route [duplicate]

I am wondering how to change the default URL for phpMyAdmin. I am using the latest version (4.0.4.1) on my CentOS 6 VPS. I am wanting to change it from /phpmyadmin to something more secure. I am unsure how to do this or where to even find my apache.conf file if there is one?
Thanks!
For ubuntu (i used ubuntu 12.04), the default phpmyadmin apache configuration can be found at /etc/phpmyadmin/apache.conf
You can open it by type sudo nano /etc/phpmyadmin/apache.conf and change the third
Alias /yournewalias /usr/share/phpmyadmin
Do not forget to restart apache service,
sudo service apache2 restart
phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
Change that to
phpMyAdmin default Apache configuration
Alias /anyname /usr/share/phpmyadmin
Then make sure to restart Apache
sudo /etc/init.d/apache2 restart
Edit this file
/etc/apache2/conf-available/phpmyadmin.conf
line 3: change the line to be
Alias /whateveryouwant /usr/share/phpmyadmin

Local Development Environments for Mac

Ok guys.
Here's my issue. I love Valet, I think it's spectacular. All of my new and recent projects are built on Laravel in some way, most of them are Laravel Spark.
However, my old legacy applications are not built on any framework at all, and all heavily rely on the .htaccess file.
Now, as we know, Valet doesn't use apache in the same way, so cannot run my old legacy applications that I still often need to work on.
I use to run MAMP PRO happily, but this doesn't run side by side with any other environment solutions and just will not work with Laravel at all. It's just not built for it - I don't want to waste time making it work, when it's less than ideal in the first place.
So what I need is a suggestion for a modern local development environment that works great with Laravel applications, but also happily runs all of my old legacy applications. Preferably looking for something that's command based on the Mac.
Any suggestions. I'm really struggling to find something I like. I love the autonomous concept of Valet and would love something like that, or just the ability to run all of my legacy applications with Valet without having to create driver files for each app or anything like that.
Thanks in advance! Love you guys.
In my mac I've only mysql server and php installed.
So when I want to develop/test an app I use:
1) for laravel: php artisan serve
2) for non-laravel: php -S 127.0.0.1:8080 -t ./
3) sometimes virtual box with linux os
4) mostly I use my digital ocean droplet for dev purposes
5) docker (:
One way of doing it would be to use vagrant. You could use Laravel Homestead and replace Nginx with Apache as webserver which would allow you to run both laravel and legacy apps, or use a tool like PuPHPet to build your own box.
To replace Nginx with Apache in Homestead you should follow these steps:
In terminal run:
cd ~/Homestead
vagrant ssh
Next you'll have to stop Nginx, disable service autoload and install apache:
sudo service nginx stop
sudo mv /etc/init/nginx.conf ~/nginx.conf.bak
sudo apt-get update
sudo apt-get install apache2
sudp service apache2 start
Now you'll have to create virtual hosts for your apps in /etc/apache2/sites-available
You could copy the default configuration:
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
sudo nano /etc/apache2/sites-available/example.com.conf
Configure your vhost to something like this:
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file and enable the vhost by running sudo a2ensite /etc/apache2/sites-available/example.com.conf
And finally restart apache sudo service apache2 restart
You can find more information on how to setup Apache on Ubuntu here

httpd server service location?

Following is not working.
/etc/init.d https restart
serive httpd restart
I don't see any file related to httpd in /etc/init.d
Although httpd server is running fine. httpd.conf file is also not present in /etc.
where should i look?
Please help in restarting the service.
Can you specify which distro you are using?
Ubuntu 12.04LTS: service apache2 restart
Debian 6: service apache2 restart
Redhat: /sbin/service httpd restart
Centos 7:
/etc/systemd/system/multi-user.target.wants/httpd.service
Which points to:
/usr/lib/systemd/system/httpd.service

How to install mod_ssl for Apache httpd?

Ok
So I installed Apache httpd a while ago and have recently come back to it to try setup SSL and get it serving several different tomcat servers.
At the moment I have two completely separate Tomcat instances serving up to slightly different versions (one for dev and one for demo say) my web app to two different ports:
example.com:8081
example.com:8082
I've successfully (back in Jan) used mod_jk to get httpd to serve those same Tomcat instances to http://www.example.com:8090/dev and http://www.example.com:8090/demo (8090 cos I've got another app running on 8080 via Jetty at this stage) using the following code in httpd.conf:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
<VirtualHost *:8090>
JkMount /devd* tomcatDev
JkMount /demo* tomcatDemo
</VirtualHost>
What I'm not trying to do is enable SSL.
I've added the following to httpd.conf:
Listen 443
<VirtualHost _default_:443>
JkMount /dev* tomcatDev
JkMount /demo* tomcatDemo
SSLEngine on
SSLCertificateFile "/opt/httpd/conf/localhost.crt"
SSLCertificateKeyFile "/opt/httpd/conf/keystore.key"
</VirtualHost>
But when I try to restart Apache with apachectl restart (yes after shutting down that other app I mentioned so it doesn't toy with https connections) I continuously get the error:
Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration. httpd not running, trying to start
I've looked in the httpd/modules dir and indeed there is no mod_ssl, only mod_jk.so and httpd.exp.
I've tried using yum to install mod_ssl, it says its already installed. Indeed I can locate mod_ssl.so in /usr/lib/httpd/modules but this is NOT the path to where I've installed httpd which is /opt/httpd and in fact /usr/lib/httpd contains nothing but the modules dir.
Can anyone tell me how to install mod_ssl properly for my installed location of httpd so I can get past this error?
I found I needed to enable the SSL module in Apache (obviously prefix commands with sudo if you are not running as root):
a2enmod ssl
then restart Apache:
/etc/init.d/apache2 restart
More details of SSL in Apache for Ubuntu / Debian here.
Are any other LoadModule commands referencing modules in the /usr/lib/httpd/modules folder? If so, you should be fine just adding LoadModule ssl_module /usr/lib/httpd/modules/mod_ssl.so to your conf file.
Otherwise, you'll want to copy the mod_ssl.so file to whatever directory the other modules are being loaded from and reference it there.
Try installing mod_ssl using following command:
yum install mod_ssl
and then reload and restart your Apache server using following commands:
systemctl reload httpd.service
systemctl restart httpd.service
This should work for most of the cases.
I used:
sudo yum install mod24_ssl
and it worked in my Amazon Linux AMI.
I don't know if it is still of interest and if things have changed ever since the thread has been posted, but the /etc/apache2/apache2.conf on my system says:
Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
directories contain particular configuration snippets which manage modules,
global configuration fragments, or virtual host configurations,
respectively.
They are activated by symlinking available configuration files from their
respective *-available/ counterparts. These should be managed by using our
helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
their respective man pages for detailed information.
And on my system the modules are installed in /usr/lib/apache2/modules.
I am running Ubuntu 20.04.2 LTS.