Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Changing Report Server URL in DFS

Adenium Systems tech support recommended that an internal URL for the DFS report server is used as opposed to an external one. This is likely due to increased performance in accessing the URL.

To change this URL, open Library Manager and right click on the Library and then select the option to edit. Go to the Settings tab and edit the Report Server URL (see below) so that it has an internal URL.

Report Server URL in DFS library settings.

Go back to the Description tab and add an internal URL (i.e. 192.168.147.7) here. If you leave this blank, DFS will use the external URL for the Internal Portal URL when you preview the planroom in the Library Manager. Each time you edit something in the library settings, you need to set the IP here or it will save as blank. The Internal IP Address always starts off as a blank and it will save like that if you press the OK button.

Internal IP Address in DFS library settings.

By

Setting Up URL Rewriting for Apache in Linux

Search Engine Friendly (SEF) URL’s are very common today with the widespread use of content management systems (CMS). These are URL’s that look like http://www.website.com/about as opposed to the conventional http://www.website.com/about.html. An SEF URL in a CMS would replace something like http://www.website.com?id=34.

The advantages of SEF over conventional URL’s is that they are shorter and easier to send to people, and they also increase the security of a web site by hiding components are being used on a page. In its webmaster guidelines, Google recommends caution in using dynamic web pages:

If you decide to use dynamic pages (i.e., the URL contains a "?" character), be aware that not every search engine spider crawls dynamic pages as well as static pages. It helps to keep the parameters short and the number of them few.

CMS users need to take extra steps for content presentation:

If your company buys a content management system, make sure that the system creates pages and links that search engines can crawl.

A CMS may generate a long and complex URL which can prevent a search engine from indexing it. An SEF URL will shorten the URL and remove the ? character which sets off warnings with web crawlers.

The first thing that you need to do is determine if mod_rewrite is installed in Apache. You can find this by using the phpinfo () function (see phpinfo.php for example). This function will display a long list of settings that PHP and Apache are using. Scroll down to apache2handler and check if mod_rewrite is in Loaded Modules.

 

[== Code: phpinfo.php =================================]

<html>
  <head>
    <title>PHP Info</title>
  </head>

  <body>
    <?php phpinfo (); ?>
  </body>
</html>

[== Code ==============================================]

 

If the module is installed, but URL rewriting doesn’t work, you’ll need to make minor changes to the httpd.conf file located at /etc/httpd/conf/. Change AllowOverride to All (see httpd.conf below). You may need to change this in several place in the configuration file before URL rewriting works.

 

[== Code: httpd.conf ==================================]

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

[== Code ==============================================]

 

After you made the changes, you’ll need to restart Apache. If your not sure how to do this, see How to Start, Stop, and Restart Apache in Linux.  Test mod_rewrite by loading the following files (.htaccess, one.html, two.html) on your web server. The RewriteBase setting in .htaccess should point to the subfolder in your web server (i.e. /rewrite/) if the default setting below doesn’t work. When you browse to one.html, you should be redirected to two.html.

You can download the code below here.

 

[== Code: .htaccess ===================================] 

RewriteEngine On
RewriteBase /
RewriteRule ^one.html$ two.html

[== Code ==============================================]

 

[== Code: one.html ====================================]

<html>
  <head>
    <title>One</title>
  </head>
  <body>
    <p>
      This is the number one.
    </p>
  </body>
</html>

[== Code ==============================================]

 

[== Code: two.html ====================================]

<html>
  <head>
    <title>Two</title>
  </head>
  <body>
    <p>
      This is the number two.
    </p>
  </body>
</html>

[== Code ==============================================]

By

How to Start, Stop, and Restart Apache in Linux

At various times, you will need to manually start and stop Apache. This could be due to making changes in the httpd.conf file which requires a restart, or the web server could be experiencing problems. You can perform these commands in a Linux terminal with httpd.

  1. To start Apache, type
    /etc/init.d/httpd start
  2. To stop Apache, type
    /etc/init.d/httpd stop
  3. To restart Apache, type
    /etc/init.d/httpd restart

Setting the ServerName

One problem that you may encounter when you start or restart Apache is that the domain name may not be defined. This can easily be fixed by opening the httpd.conf file in the /etc/init.d/conf/ folder and editing ServerName (it may have been commented out). See below for error:

Apache Error: can't determine ServerName.

Give a meaningful name to this variable and the warning will no longer be displayed when starting Apache (see below):

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
#
# If your host doesn’t have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName webserver

By

Display a List of Installed Modules in Apache

If your having problems with a feature in Apache, such as URL rewriting, you can check if the rewrite_module was installed. The following procedure works on a Linux terminal with Apache 2.x.

  1. httpd –l
    Lists compiled (static) modules.
  2. httpd –M
    Lists shared/dynamic modules. You can also use apachectl –D DUMP_MODULES.

By

Set Windows Workgroup in Linux

A Linux computer can connect to a Windows network through Samba, which can be easily in installed in Fedora and other distributions. You will need to enter the workgroup that the Windows network uses in order to connect to it. This information can be entered in the smb.conf file found at /etc/samba.

You can edit the file with the following command:

    vi /etc/samba/smb.conf

Scroll down until you find workgroup (see below) and change the name to match your Windows workgroup setting.

Setting workgroup in smb.conf.