Phusion Passenger ngnix.conf location - ruby-on-rails-3

I have a Rails 3 application that uses Phusion Passenger. I install the standalone version of Passenger using the command "gem install passenger" on my Macintosh MacBook Pro. The application works fine. Now, I want to change some configurations for the ngnix server but I can not find the location of the ngnix.conf file. I have looked in /usr/local and /opt/ and /etc/. Can someone assist me in either finding or creating the ngnix.conf?
Thanks

Look for the nginx.conf file in /opt/nginx/conf
You must have su privileges to edit this file.
Remember to stop and start nginx after making your changes

Related

apache2.4 , where to setup mod_ssl, dont see any mod_ssl.so file

Problem is the plain vanila apache is working, the moment I say sslEngine ON
it gives error, I am not able to find where any ssl setup is?
it does not create any log as well..
How this ssl setup is done? will copying a mod_ssl.so file from outside will work?
Apache version : 2.4.29
Os is RHEL 6.7
If this Red Hat documentation is not wrong the RHEL 6.x releases include Apache/2.2. Since you have Apache/2.4 I'd say you probably have an unofficial binary. Such binaries could of course have been installed in any conceivable way so this answer can easily be wrong. Yet making the hopefully safe assumption that you're still using the package manager and you just switched to a third-party repository you can try this:
yum install mod_ssl
Then tweak /etc/httpd/conf.d/ssl.conf to your liking and restart the service:
service httpd graceful
After a lot of research, I found below command which can help you show the actual issue while restarting. when I ran this it told me that .csr which I was using were wrong. I could not get this when I normally started the Apache but this command helped.
replace below with location where apache is installed and conf file is located, this will print the error ( if any).
/xxx/app/xxx/apache22/0/bin/apachectl_worker -DSSL -k start -f /xxx/app/xxx/apache22/0/conf/xxx.conf

Cannot install Kaltura oflaDemo on CentOS7

I'm currently setting up a Kaltura streaming server on CentOS 7 with mariaDB. When I come to the point the installation manual requires me to install oflaDemo via browser, I only get an empty list. No connection errors occour. The debug output states:
Host: vstream-dev.my.domain
Trying to connect
Net status: NetConnection.Connect.Success
Got the application list
Got the application list
Got the application list
So, in theory there shouldn't be a problem.
Firewall is down for testing/devel
SELinux is off (permissive)
The only error that ocoured during the installation process was packet mysql-server is not installed. But the manual states that I should use mariaDB on CentOS 7.
I tried to clone https://github.com/Red5/red5-examples and link the ofla Demo folder to /usr/lib/red5/webapps/ with no success.
Ok, I solved it.
What I did:
I cloned the repo with the red5 examples: https://github.com/Red5/red5-examples and navigated into the subfolder oflaDemo (with pom.xml).
Then I had to install maven with
yum install -y maven
and do a maven build
mvn clean install
After that, I was able to grab the file target/red5-example-oflaDemo-2.0.war. I extracted this file into a folder oflaDemo in /var/lib/red5/webapps and restarted the server. Finally, I did mkdir /usr/lib/red5/webapps/oflaDemo/streams to create a folder for the streams.
After that, I was able to navigate to the demo via
http://my.domain:5080/oflaDemo/

Create local debian repository

My goal is to demonstrate creating a local debian repository with controlled versions of tools used (e.g. compiler versions) to make a build system more predictable.
I've tried to follow this example: http://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository
but when I get to the apt-get update stage, I always get a 404 not found on the repository I've added.
The apache2 server is running, I can view the default page installed at http://localhost/html/index.html.
I am trying this with the file fortune-mod_1%3a1.99.1-7_amd64.deb installed to /var/www/debs. I create the Packages.gz file as the tutorial suggests:
dpkg-scanpackages debs /dev/null | gzip -9c > debs/Packages.gz
I also add a new file: /etc/apt/sources.list.d/myppa.list with this line:
deb http://localhost debs/
I restart the apache2 service just in case:
sudo service apache2 restart
but running:
sudo apt-get update
still produces this error:
W: Failed to fetch http://localhost/debs/Packages 404 Not Found
Is there something basic I'm missing? Ultimately, I'd like to get this working over a LAN, but first have to get it working on a single machine.
EDIT: I'm doing this on Ubuntu 14.04.
EDIT: Show contents of file /etc/apt/sources.list.d/myppa.list
tldr; use aptly
It's the easiest apt repository management tool I've found and it comes with neat tutorial showing how to create, populate, and publish your own apt repository.
References:
https://www.aptly.info/
https://www.aptly.info/tutorial/repo/
I ended up solving the problem. It was an issue with the default document root being different for the tutorial than on my system. All I did was move my debs folder to html (document root turns out to be /var/www/html, not just /var/www on my install). That did the trick.

WebDAV folder quota using Apache server

I am trying to set up a WebDAV folder on my CentOS server. I have for the most part succeeded. My problem is that I am trying to set up a size limit (quota) on the folder. I found a blog that spelled out how to do that using the "DAVSATMaxAreaSize" command. However, when I restart Apache, I get the error: "Invalid command 'DAVSATMaxAreaSize', perhaps misspelled or defined by a module not included in the server configuration". Does this mean the module that supports this command is not installed? How can I fix this?
You need to recompile your apache.
Download patch from http://www.geocities.jp/t_sat7/webdav/webdav.html
Download rpm source for apache from centos repos. Patch it with patch u downloaded and recompile apache.
I had the problem on my Ubuntu 12.04 server but I didn't want to recompile my apache. I "solved" it as follows:
I created a file container using dd (for 100MB):
dd if=/dev/zero of=/var/webdav-file-container bs=1048576 count=100
And created a filesystem in that container:
mkfs.ext4 /var/webdav-file-container
Then I mounted this container as folder for my share:
mount /var/webdav-file-container /var/webdav-share
So, now the filesystem in the container has a fixed size and apache cannot write more than the 100MB.
The only thing is that the user does not know how much space is left on that share. The Windows client report the size of it's own system drive ...

Apache is "Unable to initialize module" because of module's and PHP's API don't match after changing the PHP configuration

php -v gives this
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20090626
These options need to match in Unknown on line 0
bogus test name tests/
ps. i've upgraded from php 5.2 to 5.3. before this everything worked okay.
When you update the version of PHP (especially when going from version X.Y to version X.Z), you must update the PHP extensions as well.
This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.
And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.
How to update your PHP extensions will depend on which system you are using.
If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.
If you are on Linux, you must either :
Check what your distribution provides
Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.
just
pecl uninstall module_name
then
pecl install module_name
Your problem is within the php5-dev package. I guess you went from php5.2 on an older linux version to php5.3. I did the same thing, and when I managed to install php 5.3 there was a conflict with php5-dev. For some reason it doesn't get upgraded to the new version. Dunno why is that and I don't care, however this makes your extension compiled with the older API version, while php ofc is with the newer api version. What I did to solve this problem was:
I removed php5-dev with
sudo apt-get remove php5-dev, then I ran sudo apt-get autoremove to get rid of the leftovers that were giving me the trouble, and after that I just installed php5-dev again.
sudo apt-get install php5-dev.
Once that was done, I removed my memcache with sudo pecl uninstall memcache and installed it again sudo pecl install memcache. Now both the module and the php had the same api version so I knew right away that I had the issue solved :)
Hope it helps.
It's possible that the modules are installed, but your PHP.ini still points to an old directory.
Check the contents of /usr/lib/php/extensions. In mine, there were two directories: no-debug-non-zts-20060613 and no-debug-non-zts-20060613. Around line 428 of your php.ini, change:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
to
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
Then restart apache. This should resolve the issue.
I struggled with this issue for a long time and found out that when you run configure, just pass it the path to the correct php-config tool.
In my case, it was
./configure --with-php-config=/usr/local/zend/bin/php-config
... If you're unsure, run a locate php-config on your machine and find the right one amongst the different versions installed.
Hope this helps somebody in the future.
PS. My default php-config was set to 20090926 which is PHP 5.3. The one I manually entered as a param for ./configure was for PHP 5.4 (2010...)
I had this part enabled in my php.ini
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
After commenting these lines composer was installed in my windows 10
I had a similar issue after upgrading from PHP 5.5 to PHP 5.6. The phpize and php-config libraries being used to compile the phalcon extension were still the ones from PHP 5.5. I had to run the command below:
sudo apt-get install php5.6-dev
There will be a long stacktrace, the key information I saw was this:
update-alternatives: using /usr/bin/php-config5.6 to provide /usr/bin/php-config (php-config) in auto mode
update-alternatives: using /usr/bin/phpize5.6 to provide /usr/bin/phpize (phpize) in auto mode
I hope this helps someone.
Before you phpize, make sure to update your path ($PS1) to point to the new PHP! phpize uses your environment, and if you still have vestiges of your old PHP in your path or other parts of the environment, things will get hairy!
I'd the same error even after recompiling the modules.
But I solved it you just have to specify the absolute path of your phpize.
Here is the one that works with php 5.5. Download xampp 1.8.3 from here and download memcache dll from here
In my case in php.ini
[CLDbg]
extension=php_cl_dbg_5_3_VC9.dll
clport=6000
I removed Codelobster which support different PHP version, so need to update to:
[CLDbg]
;extension=php_cl_dbg_5_3_VC9.dll
;clport=6000
This problem has just happened to me and has been solved simply by increasing
memory_limit from 32 M to 64 M
You can adjust the value on the file where php.ini exists
locate php.ini
then choose the right file and search for memory_limit and after modifying it
you must reboot the apache
/etc/init.d/httpd restart
All the best.
In my case, I used lnmp to install php with version 5.4.45. But maybe because I installed php5-dev after lnmp (which I guess is not necessary if you installed lnmp), my phpize and php-config both point to older version tools than php.
I solved this by change the soft link of /etc/alternatives/phpize and /etc/alternatives/php-config to /usr/local/php/bin/phpize and /usr/local/php/bin/php-config.
Hopes this is helpful.
What worked for me was simply to do the following:
open the php.ini file.
Under the DYNAMIC EXTENSIONS heading, comment out the following line as
;extension=php_java.dll
Restarted Apache and all was fine