For a company campaign, we want a page to be available only between 2 datess. There a way to allow access to a file only if current date is between 2 dates using .htaccess??
Roy Rico's questions
I have a simple CGI script that is working now in production that returns a json object, and so it returns a content type of application/x-javascript. In internet explorer, this file is asked to be downloaded, but i can successfully download it.
the cgi script is perl, and output simple json object
#!/bin/perl
print "Cache-control: no-cache\n";
print "Content-type: application/x-javascript\n\n" ;
print "var whatever = { .. data here .. }";
We are migrating to new servers, and I believe that that apache is set up similarly in both locations.
The problem is, IE now does not successfully download this file. i get this error:
---------------------------
Windows Internet Explorer
---------------------------
Internet Explorer cannot download hero.cgi from lpdww554.trcw.us.aexp.com.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
---------------------------
OK
---------------------------
In debugging, i have tried text/plain, text/html and application/javascript to no avail. when using text, the output shows up properly in IE, but will not execute the javascript in the browser.
This script works in Firefox, and it works on my old server in IE (it downloads the file, does not show in browser). I can't figure out why it's not working on my new server, and i'm sure it's a HTTP header issue. I've posted my headers below.
IE New Script Headers
GET /path/script.cgi HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; MS-RTC LM 8)
Host: newserver.company.com:1091
Connection: Keep-Alive
Cookie: (cookie)
HTTP/1.1 200 OK
Date: Thu, 18 Aug 2011 18:42:56 GMT
Server: IBM_HTTP_Server
Cache-control: no-cache
Expires: 0
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/x-javascript
IE - Old Script Headers
GET /path/script.cgi HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; MS-RTC LM 8)
Host: oldserver.company.com
Connection: Keep-Alive
Cookie: cookie
HTTP/1.1 200 OK
Server: IBM_HTTP_Server
Content-Type: application/x-javascript
Date: Thu, 18 Aug 2011 18:43:39 GMT
Connection: keep-alive
Cache-Control: no-cache
Cache-Control: max-age=86400
Expires: Fri, 19 Aug 2011 18:43:38 GMT
So I set an apache variable, and i'd like to use the value to set additional variables. This is possible, I tried various methods to get this to work
SetEnv URL_STATIC http://www.static.com
Doesn't work
SetEnv URL_STATIC_MORE %{ENV:URL_STATIC}/path/path
Doesn't work either :(
SetEnv URL_STATIC_MORE ${URL_STATIC}/path/path
Ideally, i'd like URL_STATIC_MORE to be 'http://www.static.com/path/path' when all is said and done.
UPDATE:
The long winded reason i want to do this is to create a set of links that i can use in HTML/SSI. I Don't have php on my server, and that's not under my control.
So, i'd like to be able to use
<a href="<!--#echo var="ONE_VARIABLE_FOR_URL" -->">blah</a>
rather than
<a href="<!--#echo var="ROOT_URL" --><!--#echo var="PATH_URL" -->">blah</a>
Again, I do not have PHP available to me, and I have to do this for thousands of pages, so putting this in te .htaccess makes sense. I also have multiple root urls, so my config will eventually look like:
SetEnv URL_ROOT_CUSTSVC http://customerservice.company.com
SetEnv URL_ROOT_CORPORATE http://corp.company.com
SetEnv URL_ROOT_PRODUCTS http://products.company.com
SetEnv URL_ROOT_CUSTSVC_1 ${URL_ROOT_CUSTSVC}/path/1
SetEnv URL_ROOT_CUSTSVC_2 ${URL_ROOT_CUSTSVC}/path/2
SetEnv URL_ROOT_CUSTSVC_3 ${URL_ROOT_CUSTSVC}/path/3
SetEnv URL_ROOT_CORPORATE_1 ${URL_ROOT_CORPORATE}/path/1
SetEnv URL_ROOT_CORPORATE_2 ${URL_ROOT_CORPORATE}/path/2
SetEnv URL_ROOT_CORPORATE_3 ${URL_ROOT_CORPORATE}/path/3
SetEnv URL_ROOT_PRODUCTS_1 ${URL_ROOT_PRODUCTS}/path/1
SetEnv URL_ROOT_PRODUCTS_2 ${URL_ROOT_PRODUCTS}/path/2
SetEnv URL_ROOT_PRODUCTS_3 ${URL_ROOT_PRODUCTS}/path/3
IN my httpd.conf I am setting a variable
SetEnv MY_URL_WWW "http://myURLtowhatever.com"
And in my .htaccess, i have a rewrite rule, where i want to redirect to my ENV url
RewriteRule ^redirect$ %{ENV:MY_URL_WWW} [L,NC,R=301,QSA]
This is not working, and i really want it to, what am i doing wrong?
I have a samba share and it shows a weird filename in windows whenever a file or directory named ends in space or period
If I do
mkdir temp.
will look like TB5AMV~R in windows.
Is there a fix for this?
UPDATE: my config:
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
smb ports = 445
workgroup = WORKGROUP
server string =
# There was a recent security issue in Samba (Feb 5 2010), a claimed
# zero-day exploit that exploited an insecure default configuration.
# According to an Ubuntu Forums post on the topic, the "wide links" option
# now defaults to no.
follow symlinks = yes
wide links = yes
unix extensions = no
# added by roy for win7 - 2009-09-09
client ntlmv2 auth = yes
# added by roy for recycle bin
vfs object = recycle
recycle:repository = .RecycleBin
recycle:keeptree = yes
recycle:exclude = *.tmp, *~, *.bak
printcap name = /etc/printcap
load printers = no
cups options = raw
log file = /var/log/samba/%m.log
max log size = 50
security = user
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = yes
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
I'm aware that you can configure by file type (first line below) but i'd like to be more specific. I tired the 2nd line below, but didn't seem to work. Am I doing something wrong?
#AddHandler server-parsed .html
# Would like to only parse *.dyn.js, instead of all *.js files
AddHandler server-parsed .dyn.html
What will apache issue for $SERVER_NAME and $SERVER_PORT when server is behind a VIP/LoadBalancer?
I believe we will be using F5 with LTM
At work, we're trying to determine the effectiveness of domain collapsing for SEO purposes. Our current structure is to have multiple web apps served from different servers, such as
PUBLIC URLS - directly accessed by users
www1.somecompany.com/webapp1
www2.somecompany.com/webapp2
www3.somecompany.com/webapp3
I'm proposing to put an Apache proxy in front of these applications that will mask the different domains and route the requests to proper server
PUBLIC URL--------routed/forwarded to-----PRIVATE URL
www.somecompany.com/webapp1 <-----> www1.somecompany.com/webapp1
www.somecompany.com/webapp2 <-----> www2.somecompany.com/webapp2
www.somecompany.com/webapp3 <-----> www3.somecompany.com/webapp3
In terms of SEO/page rank value, does this help?
I'm looking for a tool that manages vanity url's for a single domain running on Apache (or IHS - IBM HTTP Server).
What i mean by vanity URL:
www.mycompany.com/ProjectA
would redirect toservera.mycompany.com/whatever
www.mycompany.com/ProjectB
would redirect toserverb.mycompany.com/another/directory
www.mycompany.com/FallCampaign
would redirect toservera.mycompany.com/whatever/offer.html
- etc etc
The current solution implemented consists of thousands of manually updated directories with php scripts which redirect the user. This has come a maintenance nightmare. Converting this solution to a solution using manually updated .htaccess file(s) is not an option either*.
Ideally, this tool would:
- work for an apache / IHS web server
- provide a web interface for users and administrators
- allow users to create, delete and update vanity urls
- allow users to specify case sensitivity, or case insensitivity for each vanity url
- allow users to specify redirects as HTTP 301 (permanent) or HTTP 302 (temporary) for each vanity url
- allows users to specify each vanity url as permanent (for products) or temporary with a 'take down' date (for marketing campaigns).
- provide a work flow users to submit vanity url requests, and for others to approve it
- (as a possible solution) write out a single, managed .htaccess file, provided that the file is validated by the tool prior to pushing them out to the server so that it does not negatively impact the server.
- (as a possible solution) write out directories with redirects/.htaccess files, but would also manage creating, updating and deleting these directories.
- possibly use a database backend, or a xml backend.
- provide a solution that meets these critera in a manner i didn't think of.
- (optional) provide very simple reports (number of permanent urls, number of temporary urls, upcoming temporary URLS's that are expiring, etc)
* using a single manually edited .htaccess file poses too much of a risk if an error is put into the file, could effect all urls. Multiple .htaccess files, located in directories is the same maintenance nightmare as using php redirects.
I'm trying out Win7, and i'm trying to connect to the networked samba share as I have been able to in Vista & XP with no issues. Samba is running on Ubuntu, if that helps.
I've tried changing the following in the local security policy as i've seen on as the answer on some sites, and it's still not working:
Local Policies - Security Options
Network security: LAN Manager authentication level Send LM & NTLM responses
Minimum session security for NTLM SSP
Disable Require 128-bit encryption
I am getting this in my samba error log:
[2009/09/06 15:15:53, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 192.168.1.101. Error = Connection reset by peer
Has anyone seen this issue yet?
I've been able to set up SSH authentication keys on my ubuntu, fedora core and mac systems, however, I'm not able to get SSH keys to work properly with redhat enterprise linux 5 (RHEL5). I've tried created the keys with 2048 bit encryption, but nothing seems to work. Here's the debug output that i get when i try to connect via my mac osx leopard (10.5.7)
I've checked permissions and i'm not able to figure it out... thanks
UPDATE: I've doubled checked my permissions, and they are 0700 for .ssh, and 0600 for .ssh/authorized_keys
royrico@mac ~ $ ssh -vv linuxbox
OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to linuxbox [192.168.2.3] port 22.
debug1: Connection established.
debug1: identity file /Users/royrico/.ssh/identity type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type '-----END'
debug1: identity file /Users/royrico/.ssh/id_rsa type 1
debug1: identity file /Users/royrico/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 138/256
debug2: bits set: 493/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'linuxbox' is known and matches the RSA host key.
debug1: Found key in /Users/royrico/.ssh/known_hosts:1
debug2: bits set: 504/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/royrico/.ssh/identity (0x0)
debug2: key: /Users/royrico/.ssh/id_rsa (0x107ea0)
debug2: key: /Users/royrico/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/royrico/.ssh/identity
debug1: Offering public key: /Users/royrico/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /Users/royrico/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
royrico@linuxbox's password: