I am using Netbeans to debug PHP. I dont have access to php.ini so I use .htaccess:
php_value xdebug.remote_host "localhost"
php_value xdebug.idekey "netbeans-xdebug"
php_flag xdebug.remote_autostart Off
php_flag xdebug.remote_enable On
php_value xdebug.remote_port 9000
php_value xdebug.remote_handler dbgp
php_flag xdebug.profiler_enable on
php_flag xdebug.remote_connect_back On
php_flag xdebug.extended_info On
sub.mydomain.com runs with port 8080 and 8090. I have previously used xdebug with Eclipse on this server.
The sub.mydomain.com server 's phpinfo() lists xdebug as installed together with the settings above:
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans
In Netbeans I have configured the "properties" and "run configuration" entries and port and id match also (9000, netbeans-xdebug).
There are many developers on sub.mydomain.com, might this be a problem if anyone uses port 9000?
Still if I run "debug" in Netbeans, there comes "Waiting for connection" forever.
What do I have to do?
Edit: fixed to localhost
I have managed to start the debugger with the following config:
php_value xdebug.remote_host "192.168.1.149"
php_value error_reporting 22527
php_flag xdebug.remote_autostart Off
php_flag xdebug.remote_enable On
php_value xdebug.remote_port 9009
php_value xdebug.remote_handler dbgp
php_value xdebug.remote_log "..."
php_flag xdebug.profiler_enable off
php_flag xdebug.extended_info On
php_flag xdebug.coverage_enable On
php_value error_log "..."
This is wrong:
php_value xdebug.remote_host "sub.mydomain.com"
the xdebug.remote_host setting needs to contain the IP of the machine that has your IDE on it. This of course also means that the machine running PHP/Xdebug needs to be able to connect to that IP address. This is also documented at http://xdebug.org/docs/remote#communication
Related
I have configured apache to redirect HTTPS reqests to the local running application server PUMA. PUMA is part of the Ruby on Rails framework.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
Puma Server is listening on http://localhost:3000/
When I access this apache web site from a browser I get: Too many redirections.
And idea?
I had the same issue. Try to add after your Proxy:
RequestHeader set X-Forwarded-Proto https to your ...ssl.conf which is in sites-available folder.
I had same issue, I was trying to setup a SSL termination reverse proxy with apache. I followed this article.
Using 0.0.0.0 instead of localhost worked for me.
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName exemple.com
SSLCertificateFile /path/fullchain.pem
SSLCertificateKeyFile /path/privkey.pem
ProxyPass / http://0.0.0.0:80/
ProxyPassReverse / http://0.0.0.0:80/
</VirtualHost>
</IfModule>
I deployed an loadbalanced infrustructure. I am using haproxy as the loadbalancer and cpanel as backend webservers. I created a test host on the cpanel, and I can see the site in browser when I configure the website in my /etc/host with the cpanel server ip address. But when I change the ip to the loadbalancer it forwards the requests to /usr/local/apache/htdocs/ and I get the default cpanel server page. What configurations should I use in haproxy to redirects requests correctly?
Any help is appreciated.
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2 #Log configuration
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy #Haproxy running under user and group "haproxy"
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
#HAProxy Monitoring Config
#---------------------------------------------------------------------
listen haproxy2-monitoring *:8080 #Haproxy Monitoring run on port 8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats #URL for HAProxy monitoring
stats realm Haproxy\ Statistics
stats auth lb2:F6khdTrt9g #User and Password for login to the monitoring dashboard
stats admin if TRUE
default_backend app-main #This is optionally for monitoring backend
#---------------------------------------------------------------------
# FrontEnd Configuration
#---------------------------------------------------------------------
frontend main
bind *:80
default_backend app-main
#---------------------------------------------------------------------
# BackEnd roundrobin as balance algorithm
#---------------------------------------------------------------------
backend app-main
balance roundrobin #Balance algorithm
application is up and healty - 200 status code
server cpanel1 192.168.1.110:80 check
server cpanel2 192.168.1.111:80 check
Cpanel apache config:
Listen 0.0.0.0:80
# BEGIN: HTTP vhosts list
<VirtualHost 88.99.219.13:80>
ServerName wiki.serversetup.ir
ServerAlias mail.wiki.serversetup.ir www.wiki.serversetup.ir
DocumentRoot /home/wiki/public_html
ServerAdmin webmaster#wiki.serversetup.ir
UseCanonicalName Off
CustomLog /etc/apache2/logs/domlogs/wiki.serversetup.ir combined
<IfModule log_config_module>
<IfModule logio_module>
CustomLog /etc/apache2/logs/domlogs/wiki.serversetup.ir-bytes_log "%{%s}t %I .\n%{%s}t %O ."
</IfModule>
</IfModule>
## User wiki # Needed for Cpanel::ApacheConf
<IfModule userdir_module>
<IfModule !mpm_itk.c>
<IfModule !ruid2_module>
UserDir disabled
UserDir enabled wiki
</IfModule>
</IfModule>
</IfModule>
# Enable backwards compatible Server Side Include expression parser for Apache versions >= 2.4.
# To selectively use the newer Apache 2.4 expression parser, disable SSILegacyExprParser in
# the user's .htaccess file. For more information, please read:
# http://httpd.apache.org/docs/2.4/mod/mod_include.html#ssilegacyexprparser
<IfModule include_module>
<Directory "/home/wiki/public_html">
SSILegacyExprParser On
</Directory>
</IfModule>
<IfModule suphp_module>
suPHP_UserGroup wiki wiki
</IfModule>
<IfModule suexec_module>
<IfModule !mod_ruid2.c>
SuexecUserGroup wiki wiki
</IfModule>
</IfModule>
<IfModule ruid2_module>
RMode config
RUidGid wiki wiki
</IfModule>
<IfModule mpm_itk.c>
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID wiki wiki
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ /home/wiki/public_html/cgi-bin/
</IfModule>
# To customize this VirtualHost use an include file at the following location
# Include "/etc/apache2/conf.d/userdata/std/2_4/wiki/wiki.serversetup.ir/*.conf"
</VirtualHost>
# END: HTTP vhosts list
I want to set up clustering and fail-over system with one apache httpd and two JBOSS EAP 6.4.
download
mod_cluster download
http://mod-cluster.jboss.org/mod_cluster/downloads/1-1-3
jboss eap 6.4 download
http://www.jboss.org/products/eap/download/
My httpd.config is like that:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule manager_module modules/mod_manager.so
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule advertise_module modules/mod_advertise.so
# MOD_CLUSTER_ADDS
# Adjust to you hostname and subnet.
<IfModule manager_module>
Listen 192.168.0.195:6666
ManagerBalancerName mycluster
<VirtualHost 192.168.0.195:6666>
<Location />
Require ip 192.168.0.195
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
#ServerAdvertise on http://127.0.0.1:6666
AdvertiseFrequency 5
#AdvertiseSecurityKey secret
#AdvertiseGroup 224.0.1.105:23364
EnableMCPMReceive
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 192.168.0
</Location>
</VirtualHost>
I used default standalone-ha.xml
I ran the jboss like this:
192.168.0.10:
standalone.bat -c standalone-ha.xml -b 0.0.0.0 -Djboss.node.name='node1'
192.168.0.195:
standalone.bat -c standalone-ha.xml -b 0.0.0.0 -Djboss.node.name='node2'
In 192.168.0.10, mod_cluster manager is like that:
Question)
1. Is my httpd.conf right?
2. If I use "standalone-ha.xml", is there any configuration for mod_cluster?
3. Is there any full-configuring guide with one apache and two jboss-eap-6.4?
Thanks for any advice...
Not sure about the apache configuration.
But for JBoss you need to configure mod_cluster for the advertizing.
The configuration for the JBoss server is described within the administration guide:
https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Web_HTTP_Connectors_and_HTTP_Clustering.html
The cluster howto from the community documentation contains an example with apache and JBoss configuration:
https://docs.jboss.org/author/display/AS72/AS7+Cluster+Howto
** I must use mod_cluster-1.2.x with JBOSS EAP 6.x
1. mod_cluster download
http://mod-cluster.jboss.org/mod_cluster/downloads/1-2-6-Final-bin
2. unzip and install mod_cluster
D:\httpd-2.2\bin>installconf.bat
3. edit httpd.conf
127.0.0.1 -> local ip address
(below image)
4.install EAP6.4
download from http://www.jboss.org/products/eap/download/
Nothing to configure.
5. run EAP6.4
requirements:
- balancing
- failover
- session replication
when using tcp for jgroups: at standalone-ha.xml (line:271 udp -> tcp )
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
standalone.bat -c standalone-ha.xml -b 192.168.0.10 -Djboss.node.name=node1
standalone.bat -c standalone-ha.xml -b 192.168.0.195 -Djboss.node.name=node2
-b x.x.x.x: EAP6.4 IP( for standalone-xx.xml)
I wanted to set up a mail server on my vServer hosted by Strato. The installation process seemed to easy, so I just installed the package via Plesk 12 updater.. I expected it to be "ready-to-use" but all I have got is a 403 - Forbidden when I try to access the webmail on my vServer (ubuntu 14.04 / webmail.mydomain.com)
Most of the sources I have found doesn't cover my problem at all. And if there were similiar problems, they installed roundcube manually over the console. I could try to fix it over the console, too, but I don't want to mess up the automatically installed version of roundcube.
I mean, it seems to be there. I just don't have access to it. Any ideas?
1- Make sure your roundcube is found/moved in /var/www/ path.
2- Modify your apache config file in "let say" /etc/apache2/conf.d/Example.conf and use these configuration while editing paths for your roundcubemail depending on your current roundcube default configuration:
Alias /roundcube /var/www/roundcube/roundcubemail-0.3.1
< Directory /var/www/roundcube/roundcubemail-0.3.1 >
Options Indexes FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
< IfModule mod_php4.c >
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
< /IfModule >
< IfModule mod_php5.c >
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
< /IfModule >
< /Directory>
3- If you encounter any php compatibility make sure to edit check.php in the installer folder and this will work for u.
In both the sites-available and sites-enabled folders, I have a conf file called "zend-framework.conf". This is what I have contained in the file.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName zendlocalhost
ServerAlias zendlocalhost
ServerAdmin root#localhost
DocumentRoot /var/www/zend-framework/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/zend-framework/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from All
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
This is what I have in my etc/hosts file
127.0.0.1 localhost
#127.0.1.1 lazerorca-iMac
127.0.0.1 zendlocalhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
This is what I have in my ports.conf file. I get a message saying that NameVirtualHost *:80 is going to be deprecated in a later version. I tried adding that only because I saw it in another question
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
NameVirtualHost *:80
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
This is the error I get when I go to http://zendlocalhost
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator at root#localhost to inform
them of the time this error occurred, and the actions you performed
just before this error.
More information about this error may be available in the server error
log.
This is what access.log says
127.0.0.1 - - [16/Dec/2014:15:05:22 -0500] "GET / HTTP/1.1" 500 798 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:35.0) Gecko/20100101
Firefox/35.0"
This is what the error.log says
[Tue Dec 16 15:25:20.271792 2014] [core:alert] [pid 4825] [client
127.0.0.1:60826] /var/www/zend-framework/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not
included in the server configuration
I check the .htaccess file and it looks ok to me, but evidently it isn't. here is what is in the .htaccess file
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
Interestingly enough if I go to http://zendlocalhost/phpmyadmin it pulls up
If I go to 127.0.0.1, it pulls up the generic Ubuntu apache index.html file
I am very new to Zend as in this is my first time trying it out. i know there are some crazy URL rewriting and such. I would have thought going to the root address would have pulled up the index.php file.
Thanks in advance for your help
Apache doesn't understand RewriteEngine, the very first directive in your .htaccess. This means mod_rewrite is not enabled. If you're on Ubuntu, run sudo a2enmod rewrite, and then restart Apache and try again.