Unable to find httpd directory in Amazon EC2 to configure PhpMyAdmin - apache

I am new to amazon servers. I have Installed PhpMyadmin in my Amazon EC2 server. To access my server's PhpMyadmin from my PC it seems I need to configure some files. According to this link I need to change the file /etc/httpd/conf.d/phpMyAdmin.conf But there's no directory or file named 'httpd' in /etc directory. Where can I find the httpd directory? How can I configure my machine to access phpmyadmin? I almost tried every solution in stackoverflow and none of them worked for me. Any help is appreciable.

First you need to configure web-server on your ec2 instance. You can install apache as a webserver.
For RHEL/Amazon/Fedora Distro issue following commands:-
sudo yum install httpd
Then make changes in /etc/httpd/conf.d/phpMyAdmin.conf according to the Link you are using and restart the apache web server.
sudo service httpd restart
You can access PHPMyAdmin by http://ec2-ip-address/phpmyadmin
For Ubuntu/Debian Distro issue following commands:-
sudo apt-get install apache2
Then make changes in /etc/apache2/conf-enabled/phpmyadmin.conf according to the Link you are using and restart the apache web server.
sudo service apache2 restart
You can access PHPMyAdmin by http://ec2-ip-address/phpmyadmin

Related

Apache server does not show up on EC2 IP

I am trying to install apache2 on my EC2 instance.
I did the following steps:
Launched an Ubuntu 16.4 instance with security group details
http - 80 - anywhere
https - 443 - anywhere
Once I login to my instance I did
sudo apt update
sudo apt install apache2
when I type
service apache2 status
it says that Apache is running
I assumed that after this if I go to my public IP address [xxx.xx.xx.xx] I would see the default apache server page.
But I see This site can't be reached.
The process seems pretty straightforward, what am I doing wrong?
I had this stupid case, it made me reinstall dozens of times.
Maybe my Security groups don't allow https://
Replace https:// with http:// if available.
It will work perfectly.

How to run flask on apache using mod_wsgi-express on same ip as a subdomain

I want to run flask on apache.I have already installed mod_wsgi-express and my flask application is running on port 8000(localhost:8000) but i want to run my application as a subdomain i dont want to open a new port and want to run the application on same ip using '/'(ex- localhost/application).I have already drupal running on port 80.
So basically i want my drupal run on url(localhost) and flask app on url(localhost/flaskapp) .How can i do this?
Use your main Apache to run mod_wsgi as well, instead of mod_wsgi-express. Use mod_wsgi-express just for development.
Presuming you do not have mod_wsgi installed from a system package, you can run:
sudo mod_wsgi-express install-module
and it will copy the mod_wsgi module into your Apache configuration. The command will also output two lines that you need to include in your main Apache configuration to have it load mod_wsgi and set the correct location for your Python installation or virtual environment.
You should then configure your main Apache installation manually to have it also host your Flask application using mod_wsgi. See the Flask documentation on mod_wsgi for details, but because you still want to run a PHP application, also read:
http://blog.dscpl.com.au/2014/09/hosting-php-web-applications-in.html
Because where you put configuration for Apache depends on the Linux distribution used, can't tell you exactly where you need to put stuff and what steps you may need to do to enable it.

Running apache in an ubuntu Docker container on a RedHat machine

I am new to Docker and have been trying to configure a standard default install of Apache2 running on the ubuntu:14.04 image.
This seems to work just fine when the Docker host machine is running Ubuntu, but when I try to run this same config on a machine running RHEL 6, I get apache config errors having to do with file permissions. Specifically, the default apache page returns a 403 forbidden page.
I thought the point of Docker was that I could create a container on one environment and it should behave exactly the same on any other environment.. am I way off?
Not 100% sure, but it may be that you need RHEL 7. From here you can:
docker pull rhscl/httpd-24-rhel7
See https://access.redhat.com/solutions/1378023

Start nginx on bootup when compiled from source on Ubuntu

On my Ubuntu 13.10 webserver, I installed nginx from source as I read a guide on how to do this in order to run both nginx (for my Rails apps) and Apache2 (for my php apps). I have nginx running as a proxy for apache2 on these php web apps. I installed nginx from source in to /opt/nginx, but I also have the Ubuntu default (using app-get) installed, although it isn't running.
Upon reboot, the Ubuntu default nginx starts up, so I need to manually "service nginx stop", then start the source compiled nginx using /opt/nginx/sbin/nginx.
How can I disable the Ubuntu default nginx from starting on bootup and instead have my source compiled nginx start?
Try going to /etc/init.d/ and modify the path in nginx.

How to set which folder to load with apache2 server?

My friend introduce me Linode and register.com, so I am playing with it now. I already get a domain name, while on my Linode server I am trying to set up a basic webpage so I can start to use it for my personal website. I'm following http://library.linode.com/hosting-website#sph_web-server to set up.
Here's the question, I made a testsite folder on my linode server, and a /etc/apache2/sites-available/testsite file which can be called at sudo a2ensite testsite command. (All of these are part of the tutorial.) But when I wish to switch the content for that website, I created a testsite1 and a /etc/apache2/sites-available/testsite1, then I do sudo a2ensite testsite1, but I don't know how to let the apache read the content from my testsite1 folder instead of testsite folder. The way I did that is I try sudo a2dissite testsite, so then the content in testsite1 can be read. But I hope there is better way to do that. Also I've heard apache2 can handle multiple server at the same time. How to assign which server load which folder on my linux machine? (For example, if I have abc.net and efg.net, I already link both of them to my linode server, how can I let abc.net go to read the abc folder in my linux server, while the efg.net load my efg folder?) Thanks.
You need to edit the httpd.conf file usually found in /etc/apache2/conf. Then edit the httpd.conf file and look for "Document Root" setting in this file. Change it to /etc/apache2/sites-available/testsite1 and then restart apache: /etc/init.d/apache2 restart