Is there a difference between installing mod_python via httpd.conf and conf.d in apache? - mod-python

I am working with a hosting provider who has installed mod_python for me. I followed the install instructions locally and included it in httpd.conf but they have opted to put it in conf.d/python.conf.
Is there any difference/benefit to doing it either way?

No, all the files are parsed at run time, you can include as many as you want. They've just opted to seperate out the configuration for easier management.

Related

perl lib issue - not finding lib dir

For years I have been using the following at the top of my scripts:
use lib '/var/www/vhosts/example.com/demo.example.com/cgi-bin/library';
That works fine when the lib is within the same domain space as the calling script.
However, I want to call in from a centralised library so I will have just one place to set db credentials.
So, if I adjust that line to call in from another account on the same server, it cannot find the library.
use lib '/var/www/vhosts/example2.com/demo.example2.com/cgi-bin/library';
Running on plesk, if that may make a difference. Used to run on cPanel and I had no issue.
I would appreciate a pointer, having already read some docs and I am confused.
Only someone with access to the configuration of your web server can answer this for sure, but I'd guess that each of your vhosts is running as a different user and the users can only read files from their own web space.
This approach won't work. If you want to to have a centralised module library then either install the modules that you want in the system module library (i.e. where cpan will install them by default) or create your own new centralised library somewhere that isn't under one of the vhost directories (perhaps under /opt).
However, it's worth noting that best practices for deployment of applications are moving in completely the opposite direction. It's generally considered a good idea for each application to have its own set of dependencies installed in its own module library. Using a cpanfile to record the exact versions of the dependencies that you're using makes this simple.

cPnginx plugin does not allow execution of Perl files

I had someone install cPnginx-10.7 on a cPanel server. As a result, whenever one tried to access any .pl scripts, the script would be downloaded instead of executed. I had to uninstall the plugin.
Is there a way to allow for Perl to be executed while using it?
I found 2 solutions:
1. In cpnginx admin interface from WHM change the domain to "Proxy" (Nginx proxy server in front of Apache). This slows down things though.
2. WHM > Install a Perl module, install Nginx (thus one can maintain a "hybrid" option for the domain.

Configure dependencies in RPM

I have built a RPM-package for Centos 6.6 that is installed on a machine of our customer.
This package contains our own software, customized for the specific use case, but also uses the open-source package HAProxy.
HAProxy (RPM-version 1.5.4-2.el6_7.1) comes with a default-configuration in /etc/haproxy/haproxy.conf and it cannot be customized without changing this file.
But I want the configuration to be part my generated package. RPM throws an error if the /etc/haproxy/haproxy.conf file is in my package, because it is also part of the haproxy-package.
I have worked around this problem by providing a custom upstart-script which starts HAProxy with a different config file, but this does not seem to be the right way to do this.
Is there a preferred way to handle such customizations?
In cases like this, I've created an RPM which installs configuration files into a different subdirectory, and in its %post and %preun scriptlets modifies the uncooperative package's config-files:
when installing, I renamed the original config-files, and made symbolic links from those pathnames to the overwriting config-files, and
when uninstalling, the package removed the symbolic links and restored the original package's files.
Doing it that way of course meant that my config-RPM was dependent on the original RPM. A little awkward to describe, but it works.
In followup, the issue of updating was mentioned. Updating an RPM requires special handling to avoid uninstalling things. The rpm program passes a parameter $1 which you can test in the %pre and %preun scriptlets to notice that this is an upgrade and that there is no need to save the original config-files (or restore them). The rest of the scriptlet would be the same, by copying the new versions of your config-files over the others.
Further reading:
Defining installation scripts (shows the use of `$1)
RPM upgrade uninstalls the RPM
Your approach is correct. On EL6 and sysv there is no other choice than creating custom haproxy package or custom haproxy service or create script which customer runs after installation. I see creating another service as best option.
Note that on EL7 with SystemD you have much better option as you can use Drop-In feature of SystemD. For more information see:
https://coreos.com/os/docs/latest/using-systemd-drop-in-units.html
https://wiki.archlinux.org/index.php/systemd#Drop-in_snippets
https://wiki.archlinux.org/index.php/Systemd/User#Service_example
The usual way this is done is to have a drop-in configuration directory, e.g. /etc/httpd/conf.d/, where your package would drop its configuration, and you would tell the other daemon, e.g. httpd, to do a graceful restart in your %post/%postun.
I don't know anything about HAProxy, but a quick search implies that they do not support this configuration directory concept that has been around for many years. A few people have hacked it in, but unless it is out-of-the-box, you will run into your original problem again.

magento . PHP extension "soap" must be loaded

I have shared server from domain.com
And when I try to install full package I get this issue : PHP extension "soap" must be loaded.
And I ask my customer service, he told me we can't solve this issue you must get VP host (VIP ) not shared server. Please help me to solve this issue.
Simply go in php.ini file and Find this code ;extension=php_soap.dll remove terminate sign like do it extension=php_soap.dll
I solve the problem by editing:
xampp\php\php.ini
and changing this line from:
;extension=php_soap.dll
to:
extension=php_soap.dll
In my case, only un-commenting extension=php_soap.dll line didn't work. My PHP version is 7.0 & i installed apt-get install php7.0-soap (used this because i'm using Ubuntu).After soap installation, it worked for me.
Although your question is very confusing, I believe to have understand partially what you need.
A shared server is one that other people are sharing with you. These are usually very cheap but you don't get much control over what happens there; specifically, you usually can't install stuff or have much freedom of configuration. These servers usually offer specific services (i.e., they already have PHP and MySQL installed, but you can't run, say, Ruby). You rarely (if ever) get shell access to such servers.
Dedicated servers are the opposite. You usually have full control over the machine's configuration as it's not shared with other users, but they are often way more expensive.
The reasons for this are clear: when a server is shared it's cheaper to the provider to keep and maintain a running machine, because several clients are paying for it. If you want/need a fully dedicated machine then you can manage it, but you have to pay it yourself. In this case, if you need to install PHP modules and your provider is denying you access, you must either find a provider that does allow it or find a dedicated machine. You're out of luck on that regard.
please go to this
*xampp\php\php.ini*
and find
;extension=php_soap.dll
remove the semicolon at the end and restart your appache server from the host server
On my XAMPP in php.ini this extension calls extension=soap

Perl Dancer on Apache server using Plack::Runner

I have a Perl Dancer web app which I would like to run on an apache server (on centos 6).
I put at the webapp's rootdir a sym link (index.html) to the public/dispatch.cgi script which uses the Pluck::Runner module.
The problem is when loading the page, it can't find a needed files (such as the sqlite file), in fact the routing is messed up since it looks for routing at $appname/index.pl/blabla... instead of $appname/blabla...
I think some kind of apache directive or rule is needed here but I don't these well enough.
I hope some one could help me solving this issue.
Thanks in advanced.
Roy.
It would help if you would provide your apache (vhost) configuration.
You should read the section 'Running as a cgi-script (or fast-cgi)' of Dancer deployment, because that document presents a lot differnt ways to deploy your Dancer application.
I like to use starman behind Apache as proxy. In the Perl Advent Calender 2010 you find a description how to do that.
Starman is fast for the dynamic part and apache perfect for static files and routing.