Tags:
create new tag
view all tags

SID-02421: my twiki website's image and css style is not work

Status: Unanswered Unanswered TWiki version: 6.1.0 Perl version: 5.22
Category: ImagePlugin Server OS: ubuntu 16.04 LTS Last update: 6 years ago

my twiki index website's iamge and css can work twiki version :6.1.0 apchache version:2.4 OS vesion :ubuntu 16.04 LTS

-- bian peng - 2019-12-18

Discussion and Answer

-- bian peng - 2019-12-18

ico can show,just can see character

-- bian peng - 2019-12-18

Likely an issue with the configure settings for {PubDir} and {PubUrlPath}. The {PubDir} needs to point to twiki/pub directory on your file path, such as /var/www/twiki/pub. The {PubUrlPath} is the path to the pub directory as seen from the browser, typically /pub.

Your webserver configuration needs to be set expose the {PubDir}, auch as with a <Directory "/var/www/twiki/pub"> directive. Best to use the ApacheConfigGenerator.

-- Peter Thoeny - 2019-12-18

Thanks, My TWiki directory is / var / www / TWiki, and I have generated a new twiki.conf by reusing apahce2. But I still can't display pictures by using the new configuration file. Is that the problem with Apache settings? The main interface of Apache can display pictures. So I'm confused. Is it the problem with twiki.conf ?

# Autogenerated httpd.conf file for TWiki. # Generated at http://twiki.org/cgi-bin/view/TWiki/ApacheConfigGenerator

# IMPORTANT NOTE: Make sure to enable mod_cgi in the primary apache configuration file.

# We set an environment variable called blockAccess. # # Setting a BrowserMatchNoCase to ^$ is important. It prevents TWiki from # including its own topics as URLs and also prevents other TWikis from # doing the same. This is important to prevent the most obvious # Denial of Service attacks. # # You can expand this by adding more BrowserMatchNoCase statements to # block evil browser agents trying the impossible task of mirroring a twiki # # Example: # BrowserMatchNoCase ^SiteSucker blockAccess # BrowserMatchNoCase ^$ blockAccess

BrowserMatchNoCase ^$ blockAccess

<IfModule mod_perl.c> # Mod_perl preloading PerlSwitches -T </IfModule>

# The ScriptAlias defines the bin directory as a directory where CGI # scripts are allowed. # The first parameter will be part of the URL to your installation e.g. # http://example.com/do/view/... # The second parameter must point to the physical path on your disc. ScriptAlias /do "/var/www/twiki/bin"

# The Alias defines a url that points to the twiki pub directory, which # is the root of file attachments. Alias /pub "/var/www/twiki/pub"

# This specifies the options on the TWiki scripts directory. The ExecCGI # and SetHandler tell apache that it contains scripts. "Require all granted" # lets any IP address access this URL. <Directory "/var/www/twiki/bin"> AllowOverride None Require all granted Deny from env=blockAccess

Options ExecCGI FollowSymLinks SetHandler cgi-script

# Password file for TWiki users AuthUserFile /var/www/twiki/data/.htpasswd AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith)' AuthType Basic

# File to return on access control error (e.g. wrong password) ErrorDocument 401 /do/view/TWiki/TWikiRegistration

</Directory>

# This sets the options on the pub directory, which contains attachments and # other files like CSS stylesheets and icons. AllowOverride None stops a # user installing a .htaccess file that overrides these options. # Note that files in pub are not protected by TWiki Access Controls, # so if you want to control access to files attached to topics you need to # block access to the specific directories same way as the ApacheConfigGenerator # blocks access to the pub directory of the Trash web <Directory "/var/www/twiki/pub"> Options None AllowOverride None Require all granted Deny from env=blockAccess

# This line will redefine the mime type for the most common types of scripts AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi

#add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate # reducing the load on the server significantly #IF you can, you should enable this - it will improve your twiki experience, even if you set it to under one day. # you may need to enable expires_module in your main apache config expires_module libexec/httpd/mod_expires.so mod_expires.c #<ifmodule mod_expires.c> # <filesmatch "\.(jpg|gif|png|css|js)$"> # ExpiresActive on # ExpiresDefault "access plus 11 days" # </filesmatch> #</ifmodule>

</Directory>

-- bian peng - 2019-12-19

browser html script,can't laod

<img src="/do/TWiki/TWikiLogos/T-logo-140x40-t.gif" alt="Home - this site is powered by TWiki(R)" title="Home - this site is powered by TWiki(R)" style="border:none;" border="0">

-- bian peng - 2019-12-19

# Autogenerated httpd.conf file for TWiki. # Generated at http://twiki.org/cgi-bin/view/TWiki/ApacheConfigGenerator

# IMPORTANT NOTE: Make sure to enable mod_cgi in the primary apache configuration file.

# We set an environment variable called blockAccess. # # Setting a BrowserMatchNoCase to ^$ is important. It prevents TWiki from # including its own topics as URLs and also prevents other TWikis from # doing the same. This is important to prevent the most obvious # Denial of Service attacks. # # You can expand this by adding more BrowserMatchNoCase statements to # block evil browser agents trying the impossible task of mirroring a twiki # # Example: # BrowserMatchNoCase ^SiteSucker blockAccess # BrowserMatchNoCase ^$ blockAccess

BrowserMatchNoCase ^$ blockAccess

<IfModule mod_perl.c> # Mod_perl preloading PerlSwitches -T </IfModule>

# The ScriptAlias defines the bin directory as a directory where CGI # scripts are allowed. # The first parameter will be part of the URL to your installation e.g. # http://example.com/do/view/... # The second parameter must point to the physical path on your disc. ScriptAlias /do "/var/www/twiki/bin"

# The Alias defines a url that points to the twiki pub directory, which # is the root of file attachments. Alias /pub "/var/www/twiki/pub"

# This specifies the options on the TWiki scripts directory. The ExecCGI # and SetHandler tell apache that it contains scripts. "Require all granted" # lets any IP address access this URL. <Directory "/var/www/twiki/bin"> AllowOverride None Require all granted Deny from env=blockAccess

Options ExecCGI FollowSymLinks SetHandler cgi-script

# Password file for TWiki users AuthUserFile /var/www/twiki/data/.htpasswd AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith)' AuthType Basic

# File to return on access control error (e.g. wrong password) ErrorDocument 401 /do/view/TWiki/TWikiRegistration

</Directory>

# This sets the options on the pub directory, which contains attachments and # other files like CSS stylesheets and icons. AllowOverride None stops a # user installing a .htaccess file that overrides these options. # Note that files in pub are not protected by TWiki Access Controls, # so if you want to control access to files attached to topics you need to # block access to the specific directories same way as the ApacheConfigGenerator # blocks access to the pub directory of the Trash web <Directory "/var/www/twiki/pub"> Options None AllowOverride None Require all granted Deny from env=blockAccess

# This line will redefine the mime type for the most common types of scripts AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi

#add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate # reducing the load on the server significantly #IF you can, you should enable this - it will improve your twiki experience, even if you set it to under one day. # you may need to enable expires_module in your main apache config expires_module libexec/httpd/mod_expires.so mod_expires.c #<ifmodule mod_expires.c> # <filesmatch "\.(jpg|gif|png|css|js)$"> # ExpiresActive on # ExpiresDefault "access plus 11 days" # </filesmatch> #</ifmodule>

</Directory>

-- bian peng - 2019-12-19

-- bian peng - 2019-12-23

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Unanswered
Title my twiki website's image and css style is not work
SupportCategory ImagePlugin
TWiki version 6.1.0
Server OS ubuntu 16.04 LTS
Web server

Perl version 5.22
Browser & version firfox
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2019-12-23 - BianPeng
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.