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

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.

Related

Gitlab-ee external url is not working

I installed gitlab-ee on my ubuntu 16.04 server hosted with AWS. I am not able to launch gitlab using the external url that is mentioned in gitlab.rb file. I have apache as default webserver. I used a subdomain as external url. But when i launch that url, it is still landing on default apache page and not using nginx to launch gitlab. How to solve this issue?
Apache and Nginx will probably try to use the same ports (80 & 443). The first started, in your case Apache, will start normally, but the second will not initialize properly as two programs can not listen together on the same ports.
Confirm with the command sudo gitlab-ctl status nginx. This will return the status of the integrated nginx instance.
If it is stopped, stop apache and then start nginx using sudo gitlab-ctl start nginx.

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

Unable to find httpd directory in Amazon EC2 to configure PhpMyAdmin

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

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.

Virtual Host using Apache

We have development team of 10 people working on Linux platform our application is hosted on Apache server
Now what i want if every developer is having own codebase in his directory
he can have his own httpd conf file which uses his code base and his port on that server
and whenever he changes the code base he needs run only his apache process
and there is no need to start , restart the apache server as other people should not get disturbed
so can we do this listening same server on different ports with different DocumentRoot and no need to start or restart the whole apache server only individual process of apache need to be started if any changes are done in the local conf file of that user
You need not get into the complexity of managing virtual hosts.
You can create alias for each developer which will point to his directory.
http://httpd.apache.org/docs/1.3/mod/mod_alias.html#alias
Eg :
servername.com/dev1/
in httpd conf point dev1 to developer's working folder.
Developer can update code see the result at the above url without restarting server.