How to look up admin info about a site?

usage: sitelookup [ -w  ] [ -s  ] [ -d  ]

[ -u ] [ -a ]
[ domain,wp_user,site_handle,site_root,site_admin ]

-w:wp_user is the top level unix user (admin1)
-s:site_handle is the site equivalent of wp_user (site1)
-d:domain is the hostname for a site (myco.com)
-u:site_admin is the username for a site (bob)
-a:returns info on all sites

E.g. sitelookup -d domain.com site_handle


Can’t edit PostgreSQL datasource in CFMX

The original URL where we found this solution is here: PostgreSQL DSN Config Bug

Workaround for PostgreSQL DSN Config Bug

How to fix a bug for PostgreSQL Data Source configuration in the ColdFusion MX Administrator.

The problem is that when configuring a PostgreSQL DSN according to the instructions in this TechNote, if you choose a Driver Name field of PostgreSQL, then that will trigger ColdFusion to invoke a handler template of postgresql.cfm. This handler template is defined in the configuration file neo-query.xml in ColdFusion MX’s lib directory. At one time the ColdFusion MX Administrator was going to provide a PostgreSQL JDBC driver out of the box, and that was partially implemented. However, the postgresql.cfm handler file was never implemented or even created. The result is that after first creating the data source when you return to edit it again ColdFusion will recognize the Driver Name of PostgreSQL and attempt to trigger the postgresql.cfmhandler. This causes the error:

"File not found: /CFIDE/administrator/datasources/postgresql.cfm 
The specific sequence of files included or processed is: 
C:\CFusionMX\wwwroot\CFIDE\administrator\datasources\postgresql.cfm "

The author discovered the solution on a CFTALK thread. The solution in the CFTALK thread shows how to change the handler reference from postgresql.cfm to default.cfm. Then restart ColdFusion MX. You will then be able to edit the data source correctly. Click Here for the interactive RoboHelp (Demo).
Pete Freitag pointed out in a comment that a better solution would be to find the default.cfm then make a copy named postgresql.cfm.


Bynari: Configuration files to change

$BYNARI/home/httpd/htdocs/is4web/inc/settings.inc
[line 10] $isHost = '<server>.newpush.com';

$BYNARI/home/httpd/htdocs/is4web/xml/config.xml
[replace 10.25.69.250 with correct IP i.e. 10.25.69.232]
...
           <item   option="myhostname" >
                exchange.onethinging.com
           </item>
           <item   option="mydomain" >
                onethinging.com
           </item>
           <item   option="myorigin" >
                $myhostname
           </item>
           <item   option="mydestination" >
                $myhostname,$mydomain
           </item>
           <item   option="mynetworks" >
                10.25.69.0/24
           </item>
           <item   option="inet_interfaces"   hidden="1" >
                $myhostname
           </item>
           <item   option="relay_domains" >
                $mydestination
           </item>
           <item   option="#relayhost" >
           </item>
...
           <item   option="ldapsource_server_host"   hidden="1" >
                10.25.69.232
           </item>
...
           <item   option="Listen" >
                10.25.69.232:80
           </item>
...
           <item   option="LDAPServer"   hidden="1" >
                10.25.69.232
           </item>
...
           
...
           <item   option="SocketBindTight"   hidden="1" >
                on
           </item>
...
           <template   name="proftpd" >
               %3CVirtualHost+exchange.newpush.com%3E%0A++DefaultRoot+%2Fhome%2Fftp%0A++%3CDirectory+%2F%2A%3E%0A++++%3CLimit+WRITE%3E%0A++++++DenyAll%0A++++%3C%2FLimit%3E%0A++%3C%2FDirectory%3E%0A++%3CDirectory+%2Fhome%2Fftp%2Ffreebusy%3E%0A++++%3CLimit+READ+WRITE%3E%0A++++++DenyAll%0A++++%3C%2FLimit%3E%0A++++%3CLimit+STOR%3E%0A++++++AllowAll%0A++++%3C%2FLimit%3E%0A%++3C%2FDirectory%3E%0A++Bind+10.25.69.250%0A++Port+21%0A%3C%2FVirtualHost%3E
           </template>
...

$BYNARI/etc/init.d/slapd
[replace 10.25.69.250 with correct IP]
e.g.:
start-stop-daemon --start --pidfile /var/lib/slapd.pid --exec /usr/lib/openldap/slapd -- -h "ldap://10.25.69.250:389/ ldaps://10.25.69.250:636/"
[in vi you would do ":%s/69.250/69.232/g"]

$BYNARI/etc/cyrus.conf
SERVICES {
  imap          cmd="imapd" listen="10.25.69.232:imap2" prefork=0
  pop3          cmd="pop3d" listen="10.25.69.232:pop-3" prefork=0
  imaps         cmd="imapd -s" listen="10.25.69.232:imaps" prefork=0
  pop3s         cmd="pop3d -s" listen="10.25.69.232:pop3s" prefork=0
  sieve         cmd="timsieved" listen="10.25.69.232:sieve" prefork=0
  lmtpunix      cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=0
}

$BYNARI/etc/saslauthd.conf
ldap_servers: ldap://10.25.69.232/

$BYNARI/etc/apache/conf/apache.conf
Listen 10.25.69.232:80

$BYNARI/etc/apache/conf/totalapache.conf
<IfModule mod_ssl.c>
Listen 10.25.69.232:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog builtin
SSLSessionCache shm:logs/ssl_scache(512000)
SSLSessionCacheTimeout  300
SSLMutex  sem
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog      logs/ssl_engine_log
SSLLogLevel info
</IfModule>

$BYNARI/etc/proftpd/proftpd.conf
#DefaultServer on
SocketBindTight on
<VirtualHost exchange.newpush.com>
DefaultRoot /home/ftp
<Directory /*>
  <Limit WRITE>
    DenyAll
  </Limit>
</Directory>
<Directory /home/ftp/freebusy>
  <Limit READ WRITE>
    DenyAll
  </Limit>
  <Limit STOR>
    AllowAll
  </Limit>
</Directory>
  Bind 10.25.69.250
  Port 21
</VirtualHost>

$BYNARI/etc/postfix/main.cf
# Generated by Bynari InsightServer 4.0, 03/11/03 14:49:11
# Any changes to this file will be lost
myhostname = exchange.onethinginc.com
mydomain = $myhostname
myorigin = $myhostname
mydestination = $myhostname,$mydomain
mynetworks = $myhostname, 10.25.69.0/24
relay_domains = $mydestination
inet_interfaces = $myhostname
#relayhost =
soft_bounce = yes
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
local_recipient_maps = $alias_maps ldap:ldapsource
#in_flow_delay = 1s
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
mailbox_transport = cyrus
#fallback_transport =
#luser_relay = [email protected]
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
local_destination_concurrency_limit = 5
default_destination_concurrency_limit = 20
debug_peer_level = 2
disable_mime_input_processing = no
disable_mime_output_conversion = no
disable_vrfy_command = yes
mime_boundary_length_limit = 2048
mime_nesting_limit = 20
strict_8bitmime = no
strict_mime_domain_encoding = no
#always_bcc =
#hash_queue_depth = 2
hopcount_limit = 50
max_idle = 100s

max_use = 100
delay_warning_time = 0h
initial_destination_concurrency = 2
#maximal_backoff_time = 4000s
maximal_queue_lifetime = 5d
#minimal_backoff_time = 1000s
#queue_run_delay = 1000s
bounce_size_limit = 50000
#default_process_limit = 50
#fork_attempts = 5
#fork_delay = 1a
#deliver_lock_attempts = 5
#deliver_lock_delay = 1s
#duplicate_filter_limit = 1000
#header_size_limit = 102400
#line_length_limit = 2048
#message_size_limit = 10240000
queue_minfree = 0
transport_retry_time = 60s
#stale_lock_time = 500s
allow_percent_hack = yes
#fallback_relay =
ignore_mx_lookup_error = no
smtp_connect_timeout = 30s
smtpd_timeout = 300s
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/server.pem
smtpd_tls_key_file = /etc/ssl/server.pem
smtpd_tls_CAfile = /etc/ssl/server.pem
smtpd_use_tls = yes
smtpd_enforce_tls = no
smtpd_tls_cipherlist = DEFAULT
smtpd_starttls_timeout = 300s
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, check_relay_domains
virtual_maps = ldap:ldapsource
ldapsource_server_host = 10.25.69.121
ldapsource_server_port = 389
ldapsource_timeout = 10
ldapsource_query_filter = (|(mailalias=%s)(mail=%s))
ldapsource_result_attribute = mailForward,login
ldapsource_bind = no
#fast_flush*...

 


How to secure web (admin) connections?

To secure admin server connections that are not running on a secure Apache web server, one can use “stunnel”. For example, to secure Sun One ASP, the following command will do it (to be run on the server to secure):

stunnel -D 7 -P/tmp/ -p  /usr/share/ssl/certs/imapd.pem -d 5143 -r localhost:5100

Of course, you may want to use a more appropriate secure cert.


What is PHP or ASP?

ASP, PHP, JSP are all programming languages (aka scripting languages), that allow to write dynamic websites. Dynamic websites have a business logic to perform functions such as a signup form or a full-blown eCommerce application. Dynamic websites also have a presentation logic, that allows to change the look and feel of the site based on various preferences set by either the customer or the webmaster.


Do you have an authentication routine, like htpasswd to protect web pages?

Authentication in Apache is done through htaccess, either from the configuration file or from the .htaccess file in a given directory. Note that only full directories can be easily protected with this method.
Here is how: (first log in to the shell, as this method only works if
you have shell access)

  • $ cd …/html/protected_dir
  • $ cat > .htaccess
  • AuthType Basic
  • Authname “Protected KLC directory”
  • AuthUserFile ../../control/htpasswd
  • AuthGroupFile /dev/null
  • Require valid-user
  • +d
  • $ htpasswd -c ../../control/htpasswd user_name
  • [give passwd]

After the file is created for the first time, to
add more users:

$ htpasswd ../../control/htpasswd user_name

There are also more sophisticated authentication schemes available, that allow database-driven authentication. Please contact us for more information about those solutions.


How to make the ASP engine parse the HTML files?

This solution has been contributed by one of our hosting reseller clients, Achieve Web Design and Marketing who received it from their programmer Craig Bishop. The goal of this procedure is to allow having ASP code in HTML pages, to avoid having to change URLs when a page becomes dynamic. Here is what Craig writes:

After doing a lot of research, I have come to the conclusion that I am able to have web pages saved with an HTML extension (ie: mypage.html) and within that HTML page, ASP Script can be parsed and executed just as if the page had an ASP extension (ie: mypage.asp). Unfortunately, in order to accomplish this, a modification must be done through IIS for each web site I run. I have successfully made this modification on Windows XP Pro IIS v6.0 so there should be no reason why the modification could not be performed here. I would like to ask at this time that this modification be performed as it will make Search Engine Optimization much easier if all pages had an HTML Extension rather than ASP.

The modification is quite simple and on the off chance no one has ever asked this of you before, I took the liberty of providing instructions on how to do it. Please do not take this as a doubt in your abilities.

(01)  Start up Internet Service Manager
(02)  Select the Web Site that needs to be modified.
(03)  Right click on it and select "Properties"
(04)  Select the tab "Home Directory"
(05)  Press the "Configuration" button
(06)  Select .asp from the list and press "Edit"
(07)  Make note of the information in the dialog box.
(08)  Press Cancel
(09)  Press Add
(10)  Use ".html" and the file extension and for other fields, the information you obtained in Step 07
(11)  Press OK to all the dialogs
(12)  IIS may need to be restarted but for me, I never had to.

That’s it! Quite simple actually. Please perform this modification for it will be greatly appreciated.